Monday, December 7, 2009

Find Biggest Files/Directories





Since ls does not give correct size on disk, better to
use du command.





$ du /path/to/dir | sort -nr




I hope above
command will give you the proper result you wanted.



Note: The above command may take large time, depending on

number of files in /path/to/dir . You can use depth(say 2) in
that dir.




$ du --max-depth=2 /path/to/dir | sort -nr






No comments: