I needed to do this earlier and just learned so I thought I would share:
# du -ha /var | sort -n -r | head -n 10
-a : Include all files, not just directories (du command)
-h : Human readable format, display data in 1K, 2G (du command)
-n : Numeric sort (sort command)
-r : Reverse the result of comparisons (sort command)
-n 10 : Display 10 largest file. If you want 20 largest file replace 10 with 20. (head command)
Howto: Find the largest directory/file in a directory
Started by
Guest_ptt3_*
, Jan 23 2007 11:38 AM
4 replies to this topic
#1
Guest_ptt3_*
Posted 23 January 2007 - 11:38 AM
Guest_ptt3_*
|
|
|
#2
Guest_Jame_*
Posted 23 January 2007 - 12:31 PM
Guest_Jame_*
This little command always comes in handy when I need to know where my space is gone. Glad to see others are using it as well.
#3
Posted 27 May 2007 - 05:02 PM
This will come in handy, thanks for the post!
#4
Guest_Jordan_*
Posted 28 May 2007 - 12:38 PM
Guest_Jordan_*
Thanks for the post!
#5
Guest_ptt3_*
Posted 28 May 2007 - 01:08 PM
Guest_ptt3_*
No problem, if I find anything else I'll let you know.


Sign In
Create Account

Back to top










