Closed Captioning Closed captioning available on our YouTube channel

How to use the df command: 2-Minute Linux Tips

Network World | Aug 28, 2020

In this Linux tip, learn how to use the df command. It reports on disk space. It’s important to check disk space from time to time to ensure that the system is not about to run out of space.

Copyright © 2020 IDG Communications, Inc.

Similar
Hi, this is Sandra Henry-Stocker, author of the “Unix as a Second Language” blog on NetworkWorld.
In this Linux tip, we’re going to look at the df command that reports on disk space.
With the command shown below, we display our disk usage report in a (-h) human-readable format that displays sizes in the most appropriate format – kilobytes, megabytes, gigabytes, etc.
Only two of the lines in this listing are reporting actual disk space -- /dev/sda1 and /dev/sda2. These are the only disks on this system. We can see that one is a little more than half full while the other is only 1% full.
The columns of data show the size of each of these partitions (each a section of the /dev/sda disk), how much disk space is used, how much is still available, the percentage of the space used and the mount point (where each partition is attached to the overall file system.
On this system, almost all files are in the root (/) directory which contains /etc, /usr, /home and other important directories.
It’s important to check disk space from time to time to ensure that the system is not about to run out of space. In fact, on many Linux systems, root (/) occupies a partition of its own to ensure that space allotted to it will not fill up and potential cause problems on the system. Alternately /home may have its own partition to ensure that user files don’t impact the root file system.
To report on a particular directory – both to display which file system it resides in and look at the file system’s space usage, you can run commands like these:
That’s your Linux tip for the df command. If you have questions or would like to suggest a topic, please add a comment below. And don’t forget to subscribe to the IDG Tech(talk) channel on YouTube.
If you liked this video, please hit the like and share buttons. For more Linux tips, be sure to follow us on Facebook, YouTube and NetworkWorld.com.
Popular
Featured videos from IDG.tv