View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 4 posts ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Thu Sep 25, 2008 1:56 am 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
To find all files on your FS that are larger 10 megs or larger, type the following at root:
Code:
# find / -size +10240000c -exec du -h {} \;


If you want to use a larger number like say 30 megs, substitute 30720000 in to the expression.

If the list to too extensive for your shell window, you can dump the results to a text file you can browse with your favorite text editor like so:

Code:
find / -size +10240000c -exec du -h {} \; > output


Now just nano or vim output. If you'd rather use cat, then cat it:

Code:
cat output | more


You get the idea! Credit for this goes to Tavvi Rammar. Just wanted to share...

For newbies to LINUX, a related program is called df which you can use to show you disk usage like so:
Code:
$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             4.6G  2.3G  2.1G  53% /
/dev/hda3              69G  4.7G   60G  7% /myth
tmpfs                 505M  4.0K  505M  1% /dev/shm

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 6:10 am 
Offline
Joined: Wed Dec 21, 2005 1:14 pm
Posts: 145
Location: Charlotte NC USA
Very handy, Thanks for posting it.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 10:06 am 
Offline
Joined: Sat Sep 02, 2006 9:17 am
Posts: 359
very nice...
if I could suggest:
Code:
find / -size +10240000c -exec du -h {} \; 2>/dev/null | tee output

The "2>/dev/null" suppresses all the errors non-root users get, eg. "Cannot read lost+found" etc.
The "tee" command creates your output file AND scrolls on screen so you don't have to sit drummng your fingers while waiting for the find to complete. (pipe tee, like a plumbing tee, get it? Boy, those early UNIX guys were funny.)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 25, 2008 12:57 pm 
Offline
Joined: Wed Dec 10, 2003 8:31 pm
Posts: 1996
Location: /dev/null
@jmc - good suggestion :)

_________________
Retired KM user (R4 - R6.04); friend to LH users.


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: Google [Bot] and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu