[NTLUG:Discuss] command help

Patrick R. Michaud pmichaud at pobox.com
Thu Aug 17 15:03:42 CDT 2006


On Thu, Aug 17, 2006 at 01:12:46PM -0500, brian at pongonova.net wrote:
> On Thu, Aug 17, 2006 at 05:37:02PM +0000, m m wrote:
> > what is the command to list (and ordered) first 20 biggest size file in any 
> > directory?
> 
> There isn't a single command.  But you can construct a pipe to do the
> job.
> 
> Right from the man page for ls:
> 
> ls -l | sort -n +4
> 
> To reverse the sort:
> 
> ls -l | sort -nr +4

Also:

    ls -lS      # largest files first
    ls -lSr     # largest files last

Thus:

    ls -lS | head -20   # 20 largest files
    ls -lSr | head -20  # 20 smallest files

Pm




More information about the Discuss mailing list