2 Replies Latest reply: Oct 11, 2013 4:28 AM by mt*419303*ii RSS

    file with list of .txt files in a specific directory

    mt*419303*ii

      Hi,

       

      I need to create a file with list of .txt files in a specific directory (actually the command will be used by a java application).

      I am using the below command,

       

      ls home/apptmt/park/*.txt > home/apptmt/park/reportgen.txt

       

      but this command prints output as

       

      home/apptmt/park/report1.txt

      home/apptmt/park/report2.txt

      home/apptmt/park/report3.txt

       

      I need only the files in reportgen.txt file, like

       

      report1.txt

      report2.txt

      report3.txt

       

      any one help me on the command I should use to get this output?

       

      Thanks

      MT