df

We use the df command to find total disk space and available space on a Linux / Unix file system.

The df is an acronym for disk free.

$ 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: <https://www.gnu.org/software/coreutils/>
Report df translation bugs to <https://translationproject.org/team/>
Full documentation at: <https://www.gnu.org/software/coreutils/df>
or available locally via: info '(coreutils) df invocation'

df หรือ df -k หน่วยเป็น K

$ df
Filesystem     1K-blocks      Used Available Use% Mounted on
/dev/sdc       263174212   1114200 248621856   1% /
none             8119736        28   8119708   1% /mnt/wslg
none             8119736         4   8119732   1% /mnt/wsl
tools          981111804 490438048 490673756  50% /init
none             8117652         0   8117652   0% /dev
none             8119736         0   8119736   0% /run
none             8119736         0   8119736   0% /run/lock
none             8119736         0   8119736   0% /run/shm
none             8119736         0   8119736   0% /run/user
tmpfs            8119736         0   8119736   0% /sys/fs/cgroup
drivers        981111804 490438048 490673756  50% /usr/lib/wsl/drivers
lib            981111804 490438048 490673756  50% /usr/lib/wsl/lib
none             8119736        76   8119660   1% /mnt/wslg/versions.txt
none             8119736        76   8119660   1% /mnt/wslg/doc
drvfs          981111804 490438048 490673756  50% /mnt/c

df -m หน่วยเป็น M

$ df -m
Filesystem     1M-blocks   Used Available Use% Mounted on
/dev/sdc          257007   1089    242795   1% /
none                7930      1      7930   1% /mnt/wslg
none                7930      1      7930   1% /mnt/wsl
tools             958117 478944    479174  50% /init
none                7928      0      7928   0% /dev
none                7930      0      7930   0% /run
none                7930      0      7930   0% /run/lock
none                7930      0      7930   0% /run/shm
none                7930      0      7930   0% /run/user
tmpfs               7930      0      7930   0% /sys/fs/cgroup
drivers           958117 478944    479174  50% /usr/lib/wsl/drivers
lib               958117 478944    479174  50% /usr/lib/wsl/lib
none                7930      1      7930   1% /mnt/wslg/versions.txt
none                7930      1      7930   1% /mnt/wslg/doc
drvfs             958117 478944    479174  50% /mnt/c

df -h human-readable

$ df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sdc        251G  1.1G  238G   1% /
none            7.8G   28K  7.8G   1% /mnt/wslg
none            7.8G  4.0K  7.8G   1% /mnt/wsl
tools           936G  468G  468G  50% /init
none            7.8G     0  7.8G   0% /dev
none            7.8G     0  7.8G   0% /run
none            7.8G     0  7.8G   0% /run/lock
none            7.8G     0  7.8G   0% /run/shm
none            7.8G     0  7.8G   0% /run/user
tmpfs           7.8G     0  7.8G   0% /sys/fs/cgroup
drivers         936G  468G  468G  50% /usr/lib/wsl/drivers
lib             936G  468G  468G  50% /usr/lib/wsl/lib
none            7.8G   76K  7.8G   1% /mnt/wslg/versions.txt
none            7.8G   76K  7.8G   1% /mnt/wslg/doc
drvfs           936G  468G  468G  50% /mnt/c