What is the difference between df and du commands in Linux? 1. df shows the usage of the file system. compared with du, df is more comprehensive. Df-T is the most commonly used
What is the difference between df and du commands in Linux?
1. df shows the usage of the file system. compared with du, df is more comprehensive.
Df-T is commonly used to display the usage of the file system and the type of the file system.
Example:
[Root @ localhost ~] # Df-TFilesystem Type 1K-blocks Used Available Use % Mounted on/dev/mapper/VolGroup-lv_root ext4 18134344 780860 16432296 5%/tmpfs 506176 0 506176 0%/dev/shm/dev/sda1 ext4 495844 33447 436797 8%/boot
II. du: displays disk space occupied by files or directories
The most common method is to display the size of a directory in du-sh. for example, to display the disk space usage of a user's home directory:
[Root @ syy ~] # Du-sh/home/syy9.2G/home/syy