Linux下 df 命令查看磁盘空间

Linux下可以用 df 命令查看磁盘空间

df

Filesystem     1K-blocks     Used Available Use% Mounted on
udev             8123336        0   8123336   0% /dev
tmpfs            1630560     1896   1628664   1% /run
/dev/sda6        9545920  7380424   1660872  82% /
tmpfs            8152792    29944   8122848   1% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs            8152792        0   8152792   0% /sys/fs/cgroup
/dev/loop0         13312    13312         0 100% /snap/gnome-characters/139
/dev/loop2         14848    14848         0 100% /snap/gnome-logs/37
/dev/loop1        144128   144128         0 100% /snap/gnome-3-26-1604/74
/dev/loop4         14976    14976         0 100% /snap/gnome-logs/45
/dev/loop6         35072    35072         0 100% /snap/gtk-common-themes/808
/dev/loop7          2304     2304         0 100% /snap/gnome-calculator/238
/dev/loop8         13312    13312         0 100% /snap/gnome-characters/103
/dev/loop13        35456    35456         0 100% /snap/gtk-common-themes/818
/dev/loop15        13312    13312         0 100% /snap/gnome-characters/124
/dev/loop16       144384   144384         0 100% /snap/gnome-3-26-1604/70
/dev/loop17         2432     2432         0 100% /snap/gnome-calculator/180
/dev/loop10         3840     3840         0 100% /snap/gnome-system-monitor/51
/dev/loop11         3840     3840         0 100% /snap/gnome-system-monitor/57
/dev/loop14         2304     2304         0 100% /snap/gnome-calculator/260
/dev/loop9         90368    90368         0 100% /snap/core/5897
/dev/loop12        43264    43264         0 100% /snap/gtk-common-themes/701
/dev/loop3         91648    91648         0 100% /snap/core/6130
/dev/loop5         91648    91648         0 100% /snap/core/6034
/dev/sda7       15931832 10549072   4553732  70% /home
/dev/sda5         184301    75294     95388  45% /boot
tmpfs            1630556       20   1630536   1% /run/user/121
tmpfs            1630556       56   1630500   1% /run/user/1000

查看帮助
df --help

Usage: df [OPTION]... [FILE]...
Show information about the file system on which each FILE resides,
or all file systems by default.

Mandatory arguments to long options are mandatory for short options too.
  -a, --all             include pseudo, duplicate, inaccessible file systems
  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,
                           '-BM' prints sizes in units of 1,048,576 bytes;
                           see SIZE format below
  -h, --human-readable  print sizes in powers of 1024 (e.g., 1023M)
  -H, --si              print sizes in powers of 1000 (e.g., 1.1G)
  -i, --inodes          list inode information instead of block usage
  -k                    like --block-size=1K
  -l, --local           limit listing to local file systems
      --no-sync         do not invoke sync before getting usage info (default)
      --output[=FIELD_LIST]  use the output format defined by FIELD_LIST,
                               or print all fields if FIELD_LIST is omitted.
  -P, --portability     use the POSIX output format
      --sync            invoke sync before getting usage info
      --total           elide all entries insignificant to available space,
                          and produce a grand total
  -t, --type=TYPE       limit listing to file systems of type TYPE
  -T, --print-type      print file system type
  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE
  -v                    (ignored)
      --help     display this help and exit
      --version  output version information and exit

Display values are in units of the first available SIZE from --block-size,
and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.
Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).

The SIZE argument is an integer and optional unit (example: 10K is 10*1024).
Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).

FIELD_LIST is a comma-separated list of columns to be included.  Valid
field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent',
'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).

GNU coreutils online help: <http://www.gnu.org/software/coreutils/>
Full documentation at: <http://www.gnu.org/software/coreutils/df>
or available locally via: info '(coreutils) df invocation'

以MB为块的大小查看
df -m

Filesystem     1M-blocks  Used Available Use% Mounted on
udev                7933     0      7933   0% /dev
tmpfs               1593     2      1591   1% /run
/dev/sda6           9323  7208      1622  82% /
tmpfs               7962    29      7934   1% /dev/shm
tmpfs                  5     1         5   1% /run/lock
tmpfs               7962     0      7962   0% /sys/fs/cgroup
/dev/loop0            13    13         0 100% /snap/gnome-characters/139
/dev/loop2            15    15         0 100% /snap/gnome-logs/37
/dev/loop1           141   141         0 100% /snap/gnome-3-26-1604/74
/dev/loop4            15    15         0 100% /snap/gnome-logs/45
/dev/loop6            35    35         0 100% /snap/gtk-common-themes/808
/dev/loop7             3     3         0 100% /snap/gnome-calculator/238
/dev/loop8            13    13         0 100% /snap/gnome-characters/103
/dev/loop13           35    35         0 100% /snap/gtk-common-themes/818
/dev/loop15           13    13         0 100% /snap/gnome-characters/124
/dev/loop16          141   141         0 100% /snap/gnome-3-26-1604/70
/dev/loop17            3     3         0 100% /snap/gnome-calculator/180
/dev/loop10            4     4         0 100% /snap/gnome-system-monitor/51
/dev/loop11            4     4         0 100% /snap/gnome-system-monitor/57
/dev/loop14            3     3         0 100% /snap/gnome-calculator/260
/dev/loop9            89    89         0 100% /snap/core/5897
/dev/loop12           43    43         0 100% /snap/gtk-common-themes/701
/dev/loop3            90    90         0 100% /snap/core/6130
/dev/loop5            90    90         0 100% /snap/core/6034
/dev/sda7          15559 10303      4447  70% /home
/dev/sda5            180    74        94  45% /boot
tmpfs               1593     1      1593   1% /run/user/121
tmpfs               1593     1      1593   1% /run/user/1000

以人性化的方式查看
df -h

Filesystem      Size  Used Avail Use% Mounted on
udev            7.8G     0  7.8G   0% /dev
tmpfs           1.6G  1.9M  1.6G   1% /run
/dev/sda6       9.2G  7.1G  1.6G  82% /
tmpfs           7.8G   29M  7.8G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
/dev/loop0       13M   13M     0 100% /snap/gnome-characters/139
/dev/loop2       15M   15M     0 100% /snap/gnome-logs/37
/dev/loop1      141M  141M     0 100% /snap/gnome-3-26-1604/74
/dev/loop4       15M   15M     0 100% /snap/gnome-logs/45
/dev/loop6       35M   35M     0 100% /snap/gtk-common-themes/808
/dev/loop7      2.3M  2.3M     0 100% /snap/gnome-calculator/238
/dev/loop8       13M   13M     0 100% /snap/gnome-characters/103
/dev/loop13      35M   35M     0 100% /snap/gtk-common-themes/818
/dev/loop15      13M   13M     0 100% /snap/gnome-characters/124
/dev/loop16     141M  141M     0 100% /snap/gnome-3-26-1604/70
/dev/loop17     2.4M  2.4M     0 100% /snap/gnome-calculator/180
/dev/loop10     3.8M  3.8M     0 100% /snap/gnome-system-monitor/51
/dev/loop11     3.8M  3.8M     0 100% /snap/gnome-system-monitor/57
/dev/loop14     2.3M  2.3M     0 100% /snap/gnome-calculator/260
/dev/loop9       89M   89M     0 100% /snap/core/5897
/dev/loop12      43M   43M     0 100% /snap/gtk-common-themes/701
/dev/loop3       90M   90M     0 100% /snap/core/6130
/dev/loop5       90M   90M     0 100% /snap/core/6034
/dev/sda7        16G   11G  4.4G  70% /home
/dev/sda5       180M   74M   94M  45% /boot
tmpfs           1.6G   20K  1.6G   1% /run/user/121
tmpfs           1.6G   56K  1.6G   1% /run/user/1000

查看某一路径,如/home
df -h /home

Filesystem      Size  Used Avail Use% Mounted on
/dev/sda7        16G   11G  4.4G  70% /home

猜你喜欢

转载自blog.csdn.net/weixin_43880667/article/details/86175769
今日推荐