John Gardner's Weblog

pageicon Wednesday Jul 11, 2007

find command

Seeing as some people seem to be posting their handy find commands, I thought I'd add mine:

find . -mount -ls | awk '{ print $7 " " $11 }' | sort -n
which will list all files in & under the current directory and sort them by size, very handy for finding where all the space went.

Comments:

Too time consuming. Normally I need to find out the biggest n files.

Posted by Weijun on July 11, 2007 at 05:43 PM EST #

You can always do a "tail -10" on the results to get the biggest 10 files (I often find it useful to see them all as you can find groupings of smaller files that all need to go.)

Posted by John Gardner on July 11, 2007 at 09:09 PM EST #

You mean du -ax | sort -n

Posted by Justin on July 12, 2007 at 01:43 AM EST #

I'm wondering why there's no 'sort -100' option to output only the biggest 100 lines. Theoretically this will be faster then sort all the lines and only display the last 100. It consumes less memory also.

Posted by Weijun on July 12, 2007 at 09:39 AM EST #

Post a Comment:
Comments are closed for this entry.

« November 2009
SunMonTueWedThuFriSat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
     
       
Today

Feeds

Search this blog

Links

Weblog menu

Today's referrers

Today's Page Hits: 54

Support Software Freedom Day
Change your world on September 19, 2009. Find an event near you.» Join Now