[SLUG] Re: Largest file
Jamie Adams
thefatsamurai at yahoo.co.uk
Mon Mar 20 22:20:49 GMT 2006
On Mon, 2006-03-20 at 11:56 +0000, Bob Garrood wrote:
> Hi
>
> Al Girling wrote
>
> "On Sat, Mar 18, 2006 at 11:25:04AM GMT, John Allsopp wrote:
> > > 1: Is there a command to tell me the largest file within a filesystem
> > > hierarchy (from here downwards)?
> >
> > ls -RSs seems to help, but doesn't collect it all together.
>
How about this bash script:
-----------------------------------------
cd /home/adamsj
for line in ` du -a -b 2>/dev/null| sort -g -r |head -n 200| sed
s/^[0-9]*s*//g`do
if [ -f $line ]; then
echo `du -h $line`
fi
done
-----------------------------------------
Would love to say that I did that all by myself.. but I didn't.
Jam
___________________________________________________________
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com
More information about the Scarborough
mailing list