Search⌘ K
AI Features

Identifying Available Disk Space

Explore how to identify available disk space on your system using the df command to view filesystem metadata and the du command to analyze directory sizes. Understand the differences between these commands and how to interpret their outputs to manage storage efficiently.

Every file we save takes up additional disk space. Using the ls -lh command will tell us how much space the files in a directory consume, but it doesn’t give us a holistic view of the filesystem. The df and du commands will give us more insight into where our space is going. These commands represent disk space and usage in slightly different ways.

The df command

The df command looks at the filesystem metadata. It’ll show us the filesystem’s size, used space, available space, and where it’s mounted. By default, it ...