from DUSK…

We UNIX SysAds have many many tools that can help us administer our servers. What’s great about UNIX is that you don’t have to learn the complicated commands to do what’s need to be done.


There is a saying in the UNIX world that a complex command is just a few commands used altogether. We usually apply pipes on these stuff.

Let’s take DUSK for example… or it can really be DUCKS depending on what version of DU you use.

DUSK is what I use very often every time I want to know the disk usage of the current file systems and the sub directories under that.

The command,

du -sk * | sort -n | more

does exactly that. And here’s the output when executed my home directory.

bash-2.05# du -sk * | sort -rn | more
4409 nrpe
4263 tmp
3399 xilinx
1048 dl4.files
465 unixstuff
244 scripts
30 hosts
7 doy
6 list.tqs.032206
4 LICENSE.TXT
2 help
1 netapp
1 hp84k.NIS

As you can see, it listed all the size of the files and the directories. This is a useful command specially if you’re looking for the disk space hog on you filesystem.


But why use such long command when you can use ‘dusk’ ? I don’t know about you but ‘du -sk * | sort -rn | more’ is a mouthful than ‘dusk’ right?

Here’s what you do: Simply create and alias for that command and assigned it to ‘dusk’ and you’re done.

bash:

# alias dusk=’du -sk * | sort -rn | more’

csh

% set dusk= du -sk * | sort -rn | more

Try it. It will save you tones of typing errors! 😉

Leave a Reply

Your email address will not be published. Required fields are marked *