The most common command for checking disk usage in Linux is df
.
Understanding df
The df
command (short for "disk free") displays the amount of disk space used and available on your file system. It provides information about mounted file systems, including:
- Filesystem: The name of the mounted file system.
- 1K-blocks: The total number of 1KB blocks on the file system.
- Used: The number of 1KB blocks currently used.
- Avail: The number of 1KB blocks available for use.
- Use%: The percentage of disk space used.
- Mounted on: The mount point of the file system.
Examples
Here are some examples of using the df
command:
- Displaying all mounted file systems:
df
- Displaying information about a specific file system:
df /home
- Displaying information in human-readable format:
df -h
- Displaying information about all file systems in a specific directory:
df /path/to/directory
Practical Insights
The df
command is a valuable tool for monitoring disk space usage and identifying potential issues. It can help you:
- Determine if you have enough disk space available.
- Identify file systems that are nearing capacity.
- Track disk space usage over time.
- Troubleshoot disk space problems.
Conclusion
The df
command is a powerful and versatile tool for checking disk usage in Linux. By understanding its options and usage, you can effectively monitor and manage disk space on your system.