Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2002

    output file names to a txt file in linux?

    Is there anyway of exporting a list of file names in a directory to like a txt file or something in linux

    i.e folder a has 100 different file names

    what i wud like to do is for it do output all the filenames in say a txt file or somethng

    is there such a thing

    im talking about a linux server anyone knows the commands

  2. #2
    Join Date
    Jul 2006
    To save the output of a command to a files use '>'.

    ls /path-to-your-files/ > output

    To get hidden files
    ls -a /path-to-your-files/ > output

    To distinguish between directories and files
    ls -F /path-to-your-files/ > output

    To recurse subdirectories
    ls -R /path-to-your-files/ > output

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts