[NTLUG:Discuss] command help

Stuart Johnston saj at thecommune.net
Fri Aug 18 14:01:43 CDT 2006


It'll probably be easier to get what you want with the find command.  If you are searching the whole 
disk, that is going to be A LOT of files so it will take a while.  You can add a find condition to 
ignore smaller files to speed up the sort a little.

Example:

find / -size +10000k -printf "%s\t%p\n" |sort -n


m m wrote:
> All:
> 
> Thanks  for the input. I still have the question.
> 
> Those suggestions are good but can not find (list)  the files as expected if 
> the current directory contain no files. Also you will get error if you use 
> this
> ls -l | sort -n +4
> the error message is:
> sort: open failed: +4: No such file or directory
> (try the command in a directory which contains only directories and has no 
> any files)
> 
> I guess I like the know the command the can find the biggest files in the 
> entire box not just the in the current directory.
> 
> I have tried
> 
> cd to /
> ls -lSR | head -6
> 
> or
> 
> ls -lR / | head -6
> 
> All I get is the folder list. (but I was looking for the biggest first 6 
> files)
> 
> Thanks
> 
> 
> 
> 
>> From: Wayne Walker <wwalker at bybent.com>
>> Reply-To: Wayne Walker <wwalker at bybent.com>,NTLUG Discussion List 
>> <Discuss at ntlug.org>
>> To: NTLUG Discussion List <Discuss at ntlug.org>
>> Subject: Re: [NTLUG:Discuss] command help
>> Date: Thu, 17 Aug 2006 16:39:18 -0500
>>
>> Brian is right.  I offered something like:
>>
>> Linux:
>> ls -lSr
>>
>> Portable:
>> ls -l | sort -n +4
>>
>> I've spent so long on Linux exclusively that my examples are probably
>> full of things that only work on Linux.
>>
>> On Thu, Aug 17, 2006 at 04:25:41PM -0500, Brian Koontz wrote:
>>> Just keep in mind that not all options presented here will work on all
>>> *nix platforms.  ls, especially, is widely variant between *nix
>>> flavors.  Personally, I prefer pipes that use basic commands over
>>> esoteric options.
>>>
>>>   --Brian
>>>
>>>> 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?
>>> _______________________________________________
>>> http://www.ntlug.org/mailman/listinfo/discuss
>> --
>>
>> Wayne Walker
>>
>> www.unwiredbuyer.com - when you just can't be by the computer
>>
>> wwalker at bybent.com                    Do you use Linux?!
>> http://www.bybent.com                 Get Counted!  http://counter.li.org/
>> Perl - http://www.perl.org/           Perl User Groups - http://www.pm.org/
>> Jabber:  wwalker at jabber.gnumber.com   AIM:     lwwalkerbybent
>> IRC:     wwalker on freenode.net
>>
>> _______________________________________________
>> http://www.ntlug.org/mailman/listinfo/discuss
> 
> _________________________________________________________________
> Express yourself instantly with MSN Messenger! Download today - it's FREE! 
> http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
> 
> 
> _______________________________________________
> http://www.ntlug.org/mailman/listinfo/discuss




More information about the Discuss mailing list