前言
本章主要介绍shell常用的四大指令
一、介绍
1)find命令
1.1)基本用法
例
-
find . -name “test.txt” 查找当前目录下名字为test.txt的文件
-
find . -maxdepth 1 -name “test.txt” 查找第一级目录下名字为test,txt的文件
-
find . -size +20M 查找当前目录下大于20M的
-
find . - maxdepth 1 -size +50M -type f -exec mv {} /tmp/; 查找当前第一级目录大于50M的文件并移动到tmp
-
find ./ -type f -mtime +1 查1天以前的文件
-
find ./ -type f -name “*.tar.gz” -mtime +7 | xargs rm 删除七天以前的文件
1.2)Test
2)grep命令
- grep是文本过滤命令