Tuesday, July 25, 2006

Very handy Unix Commands

If you are like me, an awesome application developer :), only spends time on Unix for the usual process or disk monitoring, not like a system programmer, these commands can be very handy...

List all directories with sizes
du -sh *
h -- displays the information in human readable format, using G (Gigabyte), M (Megabyte) etc.

List of all directories sorted by size
du -sm * | sort -nr

Size of a file system (drives in lay man terms)

--Current File system
   df .

--Current file system in human readable form
   df -h .

Size of all file systems
df -h

Find processes sorted by the maximum amount of RAM / CPU usage
top
Once inside, press Shft+Q
Now, Press the letter next to the option 'RES' (to sort by Resident Memory usage)
Press the letter next to the option 'CPU' (to sort by CPU usage)




No comments:

Post a Comment