LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-24-2005, 01:18 PM   #1
mehesque
Member
 
Registered: Oct 2003
Location: TX
Distribution: RH 8.0
Posts: 97

Rep: Reputation: 15
Need quick 1-line script help.


I would like it to work with RHEL3, but the more portable the better.

I want a line that would sort and print out the 10 or 20 largest files in my whole system.

Thanks.
 
Old 08-24-2005, 01:56 PM   #2
bruno buys
Senior Member
 
Registered: Sep 2003
Location: Rio
Distribution: Debian
Posts: 1,513

Rep: Reputation: 46
This works in debian:

du -ba|sort -bfn|tail -n 20 (or 10, if you wish)

Last edited by bruno buys; 08-24-2005 at 02:06 PM.
 
Old 08-24-2005, 02:18 PM   #3
ilikejam
Senior Member
 
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 97
How about:
Code:
find / -type f -print0  | xargs -0 ls -l | cut -d " " -f "6-" | sort -rbfn | head -n 20
Dave
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
Loop line by line script twantrd Programming 7 01-16-2005 11:47 PM
Simple / quick GUI on the command line ? michael_util Programming 3 01-05-2005 05:08 PM
Quick Q: Command to print line number X? KneeLess Linux - Software 1 05-27-2004 07:49 PM
I need a quick shell script. 360 Programming 3 03-22-2002 04:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration