df
Disk usage
Submitted by soccerfiend on Thu, 2009-05-07 02:55While the df command will show you what the disk utilization for your partitions, sometimes you need more specific details, like which files and folders are taking up all of your space.
Here is how I do this:
- df -Pacmx --max-depth=1 . |sort -g
This is kind of awkward to type out all the time, so you create an alias.
- echo "alias dus=\"df -Pacmx --max-depth=1 . |sort -g\"" >> ~/.bashrc
Now type
- source ~/.bashrc
From any directory, you can now type "dus" without the quotes to see all the files and directories sorted by size. It should also be noted that df is rounding up to the nearest megabyte.
One final note, the flags I used are specific to the GNU version of these utilities. You BSD folks will have to adjust the df and sort options.