10 July 2011

get the space in the current dir with du -ch http://goo.gl/1yMd6

If you do an:
ls -l
in any directory, the subdirectories give a zero byte value. This is a little bit offputting, as for example in the root directory /. all the directories show up a zero usage. A command exists for us to find out how much space these directories actually use, but it has nothing to do with ls.

From the command line, try typing:
du -c
, that will give you the usage on that particular directory. Du stands for Disk Usage, and -c is not the only switch that the program can accept. Try typing:
'man du'
, and come up with the various options that are available. An interesting one to try is:
du -ch
, which gives the space, and lists the space in human interpretable sizes, such as K, and Megs, rather than bytes.

via www.linux.ie

No comments:

Post a Comment