1、查找/var/log/中大于10M且小于20M的文件
find /var/log -size +10M -a -size -20M
2、创建目录/opt/0415/,在0415目录中创建文件hahahaha.log
mkdir /opt/0415/
touch /opt/0415/hahahaha.log
mkdir /opt/0415/ && touch /opt/0415/hahahaha.log
3、查找/opt/中以haha开头的文件
find /opt/ -name 'haha*' -type f
4、查找/opt/中以.log结尾的文件
find /opt -name '*.log' -type f
5、查找/etc/目录小于1M或者大于5M的文件
find /etc -size -1M -o -size +5M -type f
6、查找/目录中3分钟之内被修改的文件,且文件名非.log结尾
find / -mmin -3 ! -name '*.log -type f'
7、查找/目录十天前访问的文件
find / -atime +10 -type f
8、查找/目录十天前修改过的文件,且文件名以.txt结尾
find / -mtime +10 -type f -name '*.txt'
9、查找/目录十天内修改过的文件,且文件名以.log结尾
find / -mtime -10 -type f -name '*.log'
10、查找系统中大于1G,且30天内未被修改的文件
find / ! -mtime -30 -a -size +1G
11、查找stat命令所在位置
which stat
文件查找作业
于 2024-04-15 21:15:24 首次发布