linux命令find

在命令模式下输入

/word 这个是查找文件中“word”这个单词,是从文件上面到下面查找
?word 这个是查找文件中“word”这个单词,是从文件下上面到面查找
/string 向前搜索指定字符串
?string 向后搜索指定字符串
n 搜索指定字符串的下一个出现位置
N 搜索指定字符串的上一个出现位置
:%s/old/new/g 全文替换指定字符串
当前目录下文件大小大于10g的文件
find . -type f -size +10240M
显示详细信息
find . -type f -size +800M -print0 | xargs -0 ls -l
查出大于10g的文件并显示大小
find . -type f -size +800M -print0 | xargs -0 du -h
查出大小并排序
find . -type f -size +800M -print0 | xargs -0 du -h | sort -nr
文件夹带文件大小
du -h --max-depth=1
文件夹递归小面的文件夹大小
du -h --max-depth=2
排序
du -hm --max-depth=2 | sort -n
排序取前12
du -hm --max-depth=2 | sort -n | head -12
find / -name 监管棉花公证检验实施办法.docx

posted @ 2018-04-19 16:23  披着凉皮的狼  阅读(914)  评论(0编辑  收藏  举报