View the file and folder size in Linux (df & amp; du)
Df
Usage: df [Option]… [File]…
Displays the information of the file system where each file is located. All file systems are displayed by default.
Common options
-H,-human-readable size displayed as human readable form (e.g., 1 K 234 M 2G)
Example
[Root @ www ~] # Df-H file system capacity in use % available mount point/dev/sda1 94G 21G 68G 24%/tmpfs 1014 M 0 1014 M 0%/dev/shm
du
Usage: du [Option]… [File]…
Or: du [Option]… -Files0-from = F
Sum up the disk size of each <File>, and the total size of the directory is used.
Common options
-H,-human-readable size displayed as human readable form (e.g., 1 K 234 M 2G)
-S,-summarize only displays the total size of each parameter
-M like-block-size = 1 M block size is set to 1 M
-K like-block-size = 1 K block size is set to 1 K
Example
[root@www ~]# du -sh test/680M test/
[root@www ~]# du -sm * | sort -n0 uc.bz.key1 anaconda-ks.cfg1 derby.log1 Desktop1 index_goto_login.jsp1 index_goto_login.jsp.11 index.html1 install.log1 install.log.syslog1 ks_CentOS_5.5_32.cfg1 Sysinit.sh4 metastore_db680 test