Linux -find

ctrl + l 清屏
ctrl +d 退出 类似 quit
ctrl +c 终止
ctrl +u 删除光标之前的
ctrl +e 移动光标到最后

find /etc -name "sshd_config" #搜索etc目录下名字叫 "sshd_config"的文件
find /etc -name "sshd*" #搜索etc目录下名字大概叫 "sshd"的所有文件

find /etc/ -type d -name "sshd" #搜索etc下目录叫sshd的目录 d 目录参数
find /etc/ -type f -name "sshd" #搜索etc下文件叫sshd的文件 f 文件参数
find /etc/ -type l -name "sshd" #搜索etc下软链接叫sshd的软链接文件 l 为软链接

stat 查看文件具体信息
stat 1.txt
Linux -find
最近访问 atime
创建时间(最近更改时间) mitme
更改时间 ctime

更改文件内容ctime变化,

LANG=en 显示为英文

find / -type -mtime -1 搜索更改文件内容为1天以内的
find / -type -mtime +1 搜索更改文件内容大于1天的

find /etc/ -type f -mtime -1 -name “*.conf” 搜索文件类型并且更能内容为1天以内的名字叫.conf所有文件

搜索文件的硬链接:
find / -inum
Linux -find
find /root/ type f -mmin -120 -exec ls -l{} \; 搜索root下,修改时间最少为120分钟的文件,搜索完,并ls -l 出来。
Linux -find

find /root/ -size +10k 搜索目录下文件大于10k的
find /root/ -size -10k 搜索目录下文件小于10k的
Linux -find
find /root -type f -size -10k -exec ls -lh {} \; 搜索root下,大小大于10k的文件,并展示出来(k的单位也可以换M)
Linux -find

猜你喜欢

转载自blog.51cto.com/13451715/2176884