Text files from directory listings

From time to time, you may find it useful to have a text record of a particular directory listing. For instance, you may need to mail a list of all the JPEGs in a project folder, or you may need to send documentation of what’s going on on your hard drive to a software vendor. This is something that Tracker can’t do, but it’s easy with bash (Terminal).
Fine-tune your listing until you’ve got it right, then just use „>“ to redirect the output, then specify a path and filename. For example:
ls -l -R *.jpg > /boot/home/Desktop/jpegs.txt
This will look down recursively from the current directory, creating a detailed listing of files ending with the .jpg extension, then spit the results to a file called jpegs.txt on your desktop.

 

Comments

No comments so far.

(comments are closed)

Kategorien

 
 
Blogroll
Resources