[Super beginner's guide in 3 minutes] Done! Check disk usage

Hello!
I'm Inoue, the Persian cat at Beyond Shikoku office.
in my daily troubleshootingdf"
(Managed Service Provider),
Since a lot of data is saved to the disk every day,
if left unattended, the capacity will fill up.
So,dfI'll introduce how to
df command
Check your disk usage
# df Filesystem 1K-blocks Used Available Use% Mounted on devtmpfs 485716 0 485716 0% /dev tmpfs 503624 0 503624 0% /dev/shm tmpfs 503624 392 503232 1% /run tmpfs 503624 0 503624 0% /sys/fs/cgroup /dev/xvda1 8376300 2864700 5511600 35% / tmpfs 100728 0 100728 0% /run/user/1000
If you don't add any options, it will look like this:
-h option
# df -h Filesystem Size Used Avail Use% Mounted on devtmpfs 475M 0 475M 0% /dev tmpfs 492M 0 492M 0% /dev/shm tmpfs 492M 392K 492M 1% /run tmpfs 492M 0 492M 0% /sys/fs/cgroup /dev/xvda1 8.0G 2.8G 5.3G 35% /tmpfs 99M 0 99M 0% /run/user/1000
The display shows values in K, M, and G units, so you can see at a glance which areas are using the most.
-a option
# df -ah Filesystem Size Used Avail Use% Mounted on sysfs 0 0 0 - /sys proc 0 0 0 - /proc devtmpfs 475M 0 475M 0% /dev securityfs 0 0 0 - /sys/kernel/security tmpfs 492M 0 492M 0% /dev/shm devpts 0 0 0 - /dev/pts tmpfs 492M 392K 492M 1% /run tmpfs 492M 0 492M 0% /sys/fs/cgroup cgroup 0 0 0 - /sys/fs/cgroup/systemd pstore 0 0 0 - /sys/fs/pstore cgroup 0 0 0 - /sys/fs/cgroup/devices cgroup 0 0 0 - /sys/fs/cgroup/net_cls,net_prio cgroup 0 0 0 - /sys/fs/cgroup/freezer cgroup 0 0 0 - /sys/fs/cgroup/cpu,cpuacct cgroup 0 0 0 - /sys/fs/cgroup/memory cgroup 0 0 0 - /sys/fs/cgroup/pids cgroup 0 0 0 - /sys/fs/cgroup/perf_event cgroup 0 0 0 - /sys/fs/cgroup/blkio cgroup 0 0 0 - /sys/fs/cgroup/hugetlb cgroup 0 0 0 - /sys/fs/cgroup/cpuset /dev/xvda1 8.0G 2.8G 5.3G 35% / systemd-1 - - - - /proc/sys/fs/binfmt_misc debugfs 0 0 0 - /sys/kernel/debug mqueue 0 0 0 - /dev/mqueue hugetlbfs 0 0 0 - /dev/hugepages sunrpc 0 0 0 - /var/lib/nfs/rpc_pipefs tmpfs 99M 0 99M 0% /run/user/1000 binfmt_misc 0 0 0 - /proc/sys/fs/binfmt_misc
All disk space is displayed
-T option
# df -Th Filesystem Type Size Used Avail Use% Mounted on devtmpfs devtmpfs 475M 0 475M 0% /dev tmpfs tmpfs 492M 0 492M 0% /dev/shm tmpfs tmpfs 492M 392K 492M 1% /run tmpfs tmpfs 492M 0 492M 0% /sys/fs/cgroup /dev/xvda1 xfs 8.0G 2.8G 5.3G 35% / tmpfs tmpfs 99M 0 99M 0% /run/user/1000
Displays the file type.
Allows you to see which devices are mounted.
-i option
# df -i Filesystem Inodes IUsed IFree IUse% Mounted on devtmpfs 121429 281 121148 1% /dev tmpfs 125906 1 125905 1% /dev/shm tmpfs 125906 346 125560 1% /run tmpfs 125906 16 125890 1% /sys/fs/cgroup /dev/xvda1 4193216 46429 4146787 2% / tmpfs 125906 1 125905 1% /run/user/1000
Shows inode usage
■ Specify a directory
# df haruka Filesystem 1K-blocks Used Available Use% Mounted on /dev/xvda1 8376300 2881132 5495168 35% /
The capacity of "xvda1" where the haruka directory is stored is displayed
summary
is so frequently used that it could be considered an essential command for MSPs.
The `df`This time, we've introduced some options to help you master the `df` command.
Regularly checking disk usage and free space is crucial.
If disk space becomes full,
problems such as being unable to perform updates or save logs can occur.
Therefore, regularly checking and managing disk space is essential to prevent such problems!
I will continue to experiment and learn through trial and error,
writing blog posts about my favorite commands and commands that I personally want to understand better.
Growing every day, moving forward every day.
I must update myself every single day!!!
Thank you for reading to the end.
1
