文件和目录

查找大于80M的文件

find / -type f -size +80M

查找大于80M的文件,并显示文件大小

find / -type f -size +800M  -print0 | xargs -0 du -h

查看 /var/log 及/var/log下 子目录的大小,并按升序摆列显示

du -h --max-depth=1 /var/log |sort -n

查看 /var/log 及/var/log下 子目录的大小,并按降序摆列显示,只显示前3项

du -h --max-depth=1 /var/log |sort -nr|head -3

统计当前目录及其子目录下所有文件大小

du –sh ./

统计当前文件夹(目录)大小,并按文件大小排序

du -sh * | sort -n   

du -sk * | sort –n

查看文件大小

ll –h 文件名

ls –hl 文件名

查看文件夹中有多少文件

ls -l |grep "^-"|wc -l

查看文件夹中有多少子文件夹

ls -l |grep "^d"|wc -l

查看某文件夹下文件夹的个数,包括子文件夹里的

ls -lR|grep "^d"|wc -l

将文件名中的空格换成下划线

find . -type f -iname “*.mp3″ -exec rename “s/ /_/g” {}

原文地址:https://www.cnblogs.com/yorkyang/p/5942587.html