How to Check Free Disk Space in Linux?
One of the primary tasks of a system administrator is monitoring the disk space status on the server. In this article, we will explore several ways to find out how much free space is left on a disk in the Linux operating system.
1. Using the df Command
One of the most popular methods for checking free disk space in Linux is using the df command. This command displays information about disk space, used and free.
To find out the free disk space, execute the following command:
df -h
After executing this command, you will see information about the disks and the free space on each of them.
2. Using the du Command
For a more detailed analysis of disk space usage, you can use the du command. This command displays information about the size of files and directories in the specified directory.
To find out the size of each directory in the current folder, execute the following command:
du -h
After executing this command, you will see the size of each directory in the current folder.
3. Using the ls Command
To find out the size of each file in the current directory, you can use the ls command with the -lh flag, which allows you to display the size of each file in a convenient format.
Execute the following command:
ls -lh
After executing this command, you will see the size of each file in the current directory.
We hope this article has helped you learn how to check free disk space in the Linux operating system. Stay informed about the status of your server and monitor the status of disk space!