My Tech notes: How to Check Directory Size In Linux Also lists file size
Subscribe

Unix Documentation

Free Online Unix Training Materials

Lists many links to free Unix training materials.

Pointers and Arrays Materials

Pointers and Arrays materials Explained for C beginners

C FAQ and General Questions C Interview Questions

Powered By

Free XML Skins for Blogger

Powered by Blogger

Monday, November 17, 2008

How to Check Directory Size In Linux Also lists file size

How to check directory size in linux?
du is the answer.
du - estimate file space usage
Summarize disk usage of each FILE, recursively for directories.
useful options are
-h, --human-readable
print sizes in human readable format (e.g., 1K 234M 2G)
-s, --summarize
display only a total for each argument
To check the directory size use $ du -hs
this will give current working directory size if specified gives specific directory size ie
$du -hs /home/bhagwat/test/dir
gives size of /dir.

while df is also there but it gives disk space not directory space
df - report filesystem disk space usage
df displays the amount of disk space
available on the filesystem containing each file name argument. If no file name is given,
the space available on all currently mounted filesystems is shown.

No comments:

Post a Comment