While working with Linux, it is vital to monitor the amount of data being stored on the disk at all times. By monitoring the amount of space currently available on your drive, you may also determine whether folders or files are using up an excessive amount of space. This will assist you in managing your files in a more efficient manner. In this post, we will walk you through the process of checking disk space in Linux by using the command df.
Step-by-Step Guide to Checking Disk Space in Linux
Step 1: Open the terminal To check disk space in Linux, you need to open the terminal. You can do this by pressing the “Ctrl+Alt+T” key combination on your keyboard or by navigating to the terminal application using the graphical user interface (GUI).
Step 2: Use the df command Once you have opened the terminal, you can use the “df” command to check disk space in Linux. The “df” command stands for “disk free” and is used to display the amount of available and used disk space on your system. To use the “df” command, type the following command in the terminal:
With the “-h” option, the output is shown in a way that humans can read, making it easier to understand.
Step 3: Interpret the Output When you run the “df -h” command, you’ll see a table with the file system, size, amount of used space, amount of available space, percentage of used space, and mount point for each partition on your system. Here’s an example output:
Filesystem Size Used Avail Use% Mounted on /dev/sda1 20G 8.8G 9.6G 48% / /dev/sda2 50G 12G 36G 25% /home
In the output, the “Size” column shows the total size of the partition, the “Used” column shows the amount of disk space that is being used, the “Avail” column shows the amount of free space, the “Use%” column shows the percentage of space used, and the “Mounted on” column shows the mount point of the partition.
Step 4: Analyze the Results Once you understand what the “df -h” command tells you, you can look at the results to find out which partitions use the most space. If you see that a partition is running low on disk space, you can free up space by deleting unnecessary files or moving them to a different partition.
Get more storage today, Buy Linux VPS now! Optimize your Linux system effortlessly.
If you want to keep your Linux system working smoothly and keep from running out of storage space, it is very necessary to check the available space on the disk. You can quickly determine how much space is left on your hard disk by using the “df” command in Linux. All you need to do is follow the instructions in this article. You can keep your system working smoothly and steer clear of disk space concerns if you check the available space on the disk on a frequent basis and if you manage your files effectively.