Query file size under Linux

Generally, when the server is operating, it is necessary to check the storage size of the current file or the current directory.

1. Query the current directory and files

1. Query the size of a file

ls -sh filename

2. Check the size of all files in this directory

ll      # 是字母L

2. View disk storage

1. View overall disk usage

df -h

#  查看根目录下各个文件占用情况
du -ah --max-depth=1  /   

2. Check the usage of a directory

du -bsh /***/ 

# 例如:查看当前目录
du -bsh .

# 例如:查看 bin目录
du -bsh /bin/

Guess you like

Origin blog.csdn.net/qq_37424778/article/details/123223798