[Super introductory 3 minutes] Done! Check disk space usage
Hello!
This is Inoue, a Persian cat from Beyond Shikoku Office.
df ''
when dealing with problems on a daily basis.It is a command to check and manage disk capacity.
A lot of data remains on the disk every day, so
if you leave it alone, it will fill up to capacity.
In such cases, we will introduce how to use the df
df command
Check 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 5036 24 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
displays in K, M, and G units , so you can tell at a glance where you are using it 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 capacities are 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
Display file type.
You can check the mounted devices.
■-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
Display inode usage.
■Specify the 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
This command is so frequently used that it can be called an essential command for MSPs.
" df " command, we have introduced some options this time.
It is important to regularly monitor disk usage and free space.
If the disk space becomes full,
problems will occur such as not being able to update or not being able to leave logs.
Therefore, it is important to regularly check and organize your disk space to avoid problems!
I will continue to write blogs about my favorite commands and commands that I personally want to understand better, through trial and error
Growing every day, moving forward every day.
I have to update myself every day! ! !
Thank you for reading to the end.