I'm primarily a
User Developer Sysadmin A mixture Something else entirely .. ( 393 votes ~ 7 comments )
You are not currently logged in. If you do not have a user account then please consider creating one and logging in before you post your comment. This will allow you to track replies to your comment, and take part in the site much more freely.
To add your comment, fill in all the boxes below and then preview it to make sure you're happy with the way that it looks.
This is the comment you were replying to, attached to the article Keeping track of disk space:
#3 Re: Keeping track of disk space Posted by maurits (80.126.xx.xx) on Fri 20 May 2005 at 11:06 I use two aliases for du: alias dum='du --max-depth=1' alias duh='du -h --max-depth=1' dum signifies max-depth and duh signifies human-readable. "--max-depth=1" makes sure you get the disk usage for the complete directory and not for every individual ((sub)sub)subdirectory. Most of the time that is the info I want. maurits@mauritsvanrees:~/web$ duh 93K ./links 24K ./images 15M ./preken 1,1M ./studie 232K ./weblog 16M . The human readable part does not work so well when sorting: maurits@mauritsvanrees:~/web$ duh | sort -rg 232K ./weblog 93K ./links 24K ./images 16M . 15M ./preken 1,1M ./studie This sorts by numerical value, but the difference between a number with M or K at the end goes beyond sort. [BTW, I don't see any difference between 'sort -n' and 'sort -g'.] That's where the 'dum' alias comes in handy: maurits@mauritsvanrees:~/web$ dum | sort -rg 16058 . 14593 ./preken 1081 ./studie 232 ./weblog 93 ./links 24 ./images
alias dum='du --max-depth=1' alias duh='du -h --max-depth=1'
maurits@mauritsvanrees:~/web$ duh 93K ./links 24K ./images 15M ./preken 1,1M ./studie 232K ./weblog 16M .
maurits@mauritsvanrees:~/web$ duh | sort -rg 232K ./weblog 93K ./links 24K ./images 16M . 15M ./preken 1,1M ./studie
maurits@mauritsvanrees:~/web$ dum | sort -rg 16058 . 14593 ./preken 1081 ./studie 232 ./weblog 93 ./links 24 ./images
Posting Format:
Inappropriate comments will be removed.
Some help on entry formatting is available
Username:
Password:
[ Advanced Login ]
Register Account