当前位置:网站首页>DF command – displays disk space usage

DF command – displays disk space usage

2022-06-25 05:59:00 ProYuan28

df The full English name of the order is “Disk Free”, As the name implies, the function is used to display the available disk space on the system . The default display unit is KB, It is recommended to use “df -h” The parameter combination of , Automatically change the appropriate unit according to the disk capacity , Better for reading .

This command is commonly used to check how much space the disk occupies 、 How much space and other information is left .

Grammar format : df [ Parameters ] [ Specified file ]

Common parameters :

-a Show all system files
-B < Block size > Specifies the block size for display
-h Show... In an easy to read manner
-H With 1000 Bytes are converted to display
-i Display index byte information
-k Specify the block size as 1KB
-l Show only local file systems
-t < File system type > Only the file system of the specified type is displayed
-T Displays the file system type when outputting
-- -sync Before getting disk usage information , Execute first sync command

Reference examples

Display disk partition usage :

[[email protected] ~]# df
 file system                              1K- block      Already used       You can use     Already used %  Mount point 
devtmpfs                           1980612       0  1980612    0% /dev
tmpfs                              1994756       0  1994756    0% /dev/shm
tmpfs                              1994756    1040  1993716    1% /run
tmpfs                              1994756       0  1994756    0% /sys/fs/cgroup
/dev/mapper/fedora_linuxhell-root 15718400 2040836 13677564   13% /
tmpfs                              1994756       4  1994752    1% /tmp
/dev/sda1                           999320  128264   802244   14% /boot
tmpfs                               398948       0   398948   0% /run/user/0

Display partition usage in an easy to read way :

[[email protected] ~]# df -h
  file system                             Capacity     Already used     You can use    Already used %  Mount point 
 devtmpfs                           1.9G     0  1.9G    0% /dev
 tmpfs                              2.0G     0  2.0G    0% /dev/shm
 tmpfs                              2.0G  1.1M  2.0G    1% /run
 tmpfs                              2.0G     0  2.0G    0% /sys/fs/cgroup
 /dev/mapper/fedora_linuxhell-root   15G  2.0G   14G   13% /
 tmpfs                              2.0G  4.0K  2.0G    1% /tmp
 /dev/sda1                          976M  126M  784M   14% /boot
 tmpfs                              390M     0  390M    0% /run/user/0

Display the disk usage of the partition where the specified file is located :

[[email protected] ~]# df /etc/dhcp
 file system                              1K- block      Already used       You can use     Already used %  Mount point 
/dev/mapper/fedora_linuxcool-root 15718400 2040836 13677564   13% /

The display file type is ext4 Disk usage for :

[[email protected] ~]# df -t ext4
 file system         1K- block     Already used     You can use      Already used %  Mount point 
/dev/sda1      999320 128264 802244   14% /boot
原网站

版权声明
本文为[ProYuan28]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202201251057438.html