Hard Disk Allocation with df and du

From Thomas-Krenn-Wiki
Jump to navigation Jump to search

The following commands can be used to display the hard drive usage on Linux-based operating systems on the console.

df

disk free displays the free (meaning available) storage space on the hard disk.

  • Display free storage space for the entire file system
df -h
  • Display free storage space for the local file system
df -hl

du

disk usage displays the storage space in use (meaning not available) on the hard disk.

  • Display all storage space in use for the system
du -sh /
  • Display the storage space for the Media folder, but ignore all BMP files.
du --exclude="*.bmp*" -sh media/
  • Display the storage space for the current directory.
du -sh ./

Related articles

Instructions for easy image creation with Clonezilla
Linux /etc/shadow file
Linux Cluster Management Console (LCMC) GUI