add
This commit is contained in:
14
998-常用脚本/存储空间清理脚本/服务器常用目录空间检查.sh
Normal file
14
998-常用脚本/存储空间清理脚本/服务器常用目录空间检查.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
common_dir_list=(/var/lib/docker/ /var/log/ /root/ /data /home)
|
||||
|
||||
# 查找最深3级目录并计算空间占用
|
||||
|
||||
for dir in "${common_dir_list[@]}"
|
||||
do
|
||||
echo "start to find disk usage of $dir"
|
||||
find "$dir" -mindepth 1 -maxdepth 6 -exec du -sh {} + | sort -hr | head -n 10
|
||||
echo ""
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user