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.
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.
Comments