background

Online service is suddenly unacceptably slow… Think about checking the server logs.

Log in to the server and go to the log directory.llFound a lot of logs… So much? How much space does that take up?View space command… Embarrassed. I don’t remember. Record it again!

The command

Ubuntu Check disk space command

Df {options} {file}

df -h

The command describe
df -a List of all file systems (KB)
df -h View the partition size for each path
df -i Display iNode information (unit: KB)
df -k The block is 1024 bytes
df -l Only local file systems are displayed
df -hl Check the free disk space
Du -sh [Directory name] Returns the size of the directory in G.
Du-sm [folder] Returns the total number of folders in M
Du -h [directory name] View all file sizes under the specified folder, including folders

conclusion

Linux command multi-use, multi-recite, so that you will not forget!

reference

  • www.cnblogs.com/mafeng/p/10…