Friday, July 20, 2007

finding large files in Linux

I wanted to clean out some old large files on my hard drive. What I needed to help me do this was a listing of files by size. My plan was to find the large files and delete the ones I no longer needed.I used find, sort and less to do this. The code was:
$ find . -printf '%s %h%f' | sort -nr | less

the options in find for print f that I used were %s (size in bytes), %h (directory) and %f (file name)
the options in sort I used were -n (numeric osrt) and r (reverse [high to low].

Once the list was run in a terminal window I opened a second window and removed the files I no longer needed.


Blogger knicksgrl0917 said...

hey! i'm going to cali this weekend and won't be back until is the website i was talking about where i made extra summer cash. Later! the website is here

12:57 PM  

Post a Comment

<< Home