Quantcast

Creativebits.org

an All Creative World site
Ivan's picture

Save a directory list to a file

terminal iconIf for whatever reason you need a list of files within a certain directory in text format you can do so using the ls Terminal command.

Just open Terminal, navigate to the required directory and then enter one of these commands to save the information to the directory.txt file:

Only the files within the directory: ls > directory.txt
Lists all subdirectories recursively: ls -R > directory.txt
Sorts by time of last modification: ls -t > directory.txt

For more options check this page.

Commenting on this Blog entry is closed.

morse's picture
69 pencils

thank you

jozefk's picture
250 pencils

# man ls

pesonaly I like to use it as # ls -BgGh
but for list of files in text format I like # ls -m > textfilename.txt

and the # stat command is nice one because you can get more control of the output. like a format for example.
just an example:
# stat --format="--NAME: %n
> --ACCESS: %x
> --MODIFY: %y
> " * > textfilename.txt

There is a manual page for stat command as well: # man stat

fedora FREEDOM. FRIENDS. FEATURES. FIRST.
fedoraproject.org

steveballmer's picture
627 pencils

Back to the terminal people!
LOL
You people crack me up!

http://stevefakeballmer.wordpress.com/
I am not Steve Ballmer pretending not to be me!

shumaker212's picture
1 pencil

I use Print directory to print the directory listing to a file..

Find Here : http://www.print-directory.com

jozefk's picture
250 pencils

Is that working with Unix Operating Systems?

fedora FREEDOM. FRIENDS. FEATURES. FIRST.
fedoraproject.org

Creativebits is a blog about creativity, design and Macs. We also have a critique section where you can post your work to get opinions and a forum to discuss any design related topics.

Recommend us on Google

Latest critique

  • Lava mole
  • bullet energy drink rebranding

Marketplace