LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-26-2006, 02:00 PM   #1
s0n|k
Member
 
Registered: Feb 2006
Distribution: RHEL4
Posts: 80

Rep: Reputation: 15
Linux Utility


Is there a linux utility that can show me like the top 3 files in which use more hard drive space?
 
Old 02-26-2006, 02:06 PM   #2
ckoniecny
Member
 
Registered: Oct 2005
Posts: 162

Rep: Reputation: 30
You could run the find command:

Code:
find / -size +100000c -print
This would display files over 100 MB.
 
Old 02-26-2006, 02:19 PM   #3
visaris
Member
 
Registered: Dec 2004
Distribution: gentoo
Posts: 190

Rep: Reputation: 30
Code:
find / -name "*" -exec ls -l {} \; | grep -e "^[^t][^o][^t][^a][^l]"  | sort -g -r -k 5 | head -n 20
This will show you the 20 largest files on your harddrive, their size, and location.
 
Old 02-26-2006, 02:40 PM   #4
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
Or even better:

Code:
find / -printf "%k %p\n" | sort -g -r | head -n 20
The previous one:

Code:
find / -name "*" -exec ls -l {} \; | grep -e "^[^t][^o][^t][^a][^l]"  | sort -g -r -k 5 | head -n 20
will mostly work, except it will list some files twice - once when ls -l is executed on the files' containing directory, and another time when ls -l is executed on the files themselves.
 
Old 02-26-2006, 03:08 PM   #5
s0n|k
Member
 
Registered: Feb 2006
Distribution: RHEL4
Posts: 80

Original Poster
Rep: Reputation: 15
ahhh I see. Thanks guys!
 
  


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
does linux have a scandisk utility? spyghost Linux - Newbie 14 02-15-2006 06:16 PM
is there a linux utility.... linuxnube Linux - Software 4 01-22-2004 02:45 PM
simple linux utility that does this? squip Linux - Newbie 1 10-07-2003 04:49 PM
Help with a linux utility Ripper951 Linux - General 6 01-12-2003 02:00 PM
Make Utility and RT Linux twizzard Linux - Newbie 3 06-28-2002 09:54 PM


All times are GMT -5. The time now is 05:56 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration