title | published | description | tags | cover_image | canonical_url | series |
---|---|---|---|---|---|---|
Managing Disk Space in Linux with the df Command |
false |
Linux commands |
bash, linux, beginners |
Linux from A to Z |
The df
command is a useful tool for managing disk space on your Linux system. It displays information about the file system disk space usage, including the amount of free space, used space, and the percentage of space used. Here are some examples of using df
command:
df -h
dh -hT /dev/sda1
df -aTh
df -hT -x tmpfs /dev/sda1
df -BT
df -i /dev/sda1
df --output=source,fstype,size,used,avail,pcent,target
df -hT | sort -k 3
df -hT | sort -k 3 -r
df -hT | tail -n +2
- Use the
h
option to display disk space usage in human-readable format (e.g., GB, MB) - Use the
x
option to exclude file systems of a certain type (e.g., tmpfs,devtmpfs) - Use the
-output
option to customize the output format of the command - Use the
sort
andtail
commands to sort and filter the output as needed.
In summary, the df
command is a powerful tool for managing disk space on your Linux system. With the various options available, you can easily view and analyze disk space usage for specific file systems and customize the output format.
Remember to use the available sorting and filtering commands to further manage and analyze the output.
Thank you for reading 🧑💻
Stay tuned for more 🚀
✌️ and logout