Linux - disk free command (df)

> Operating System - Kernel (Windows, Unix, Linux) > Linux / Unix > Linux - Disk (storage devices)

1 - About

disk free command (df) is a storage function that can give you the free space.

Advertising

3 - Example

df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       17G   16G     0 100% /
/dev/sda1              99M   12M   82M  13% /boot
tmpfs                 1.5G     0  1.5G   0% /dev/shm

4 - Difference between du and df

du shows the space by file whereas df shows the space by block of file.

If there is a big difference in their output, try to see if some deleted file are not held by a process as open.

Example with linux and lsof

 lsof /device | grep -i deleted

deleted_open_file.jpg

If this is the case, you need to restart the process to reclaim this buffers.

os/linux/disk/df.txt · Last modified: 2019/03/20 12:21 by gerardnico