Monday, April 8, 2013

List space used by directory

Traditionally I use commands like "ls -lh" to give me size of files inside a directory but if you try and read the size of a directory with this it will not give you the correct sizing. 

There is all sorts of ways of getting the directory but I now use "du -sh" directory_name to show me the correct size.  Writing this into my bash scripts now and will post when I am done to give you a hand way of finding out your disk usage.

example output:

 du -s Music/
1096972    Music/


du -sh Music/
1.1G    Music/

No comments: