Quantcast
A Graphics.com 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.

morse's picture
56 pencils

thank you

jozefk's picture
195 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

Linux Counter The Ubuntu Counter Project - user number # 29835

steveballmer's picture
273 pencils

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

http://fakesteveballmer.blogspot.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
195 pencils

Is that working with Unix Operating Systems?

Linux Counter The Ubuntu Counter Project - user number # 29835

Latest critique

  • TR1 - Episde  4.1
  • Farmers Market Logo

On Demand Videos

Photoshop: From Ho-hum to Wow!
You can use Photoshop to bring out the magic of photos that are muddy, soft, or blandly composed.
watch a preview

On Demand Videos: Video tutorials for advertising pros and designers providing tools and information you can trust — and use — on your very next project. Subscribe today!

Creativebits recommends

stocklogos.com logoawards.mediabistro.com

Marketplace