which
whereis
find
-name (*匹配任意字符?匹配任意字符)
-size 文件大小 block 512字节
100MB=102400KB=204800block
+大于 -小于
find / -size +204800
-user 文件所有者
find /home hehe
时间:
天ctime,atime,mtime
分钟cmin,amin,mmin
c-change a-access m-modify
-之内 +超过
find /etc --mmin -120
连接符
-a and 逻辑与-o or逻辑或
-type 文件类型 f二进制 l软链接 d目录
find /etc --mmin -120 -a -type l
find /etc -name inittab -exec ls -l {} \;
{}find结果
\转意符
;结果
-exec改为-ok就会询问确认
创建二逼文件:touch "a b" touch -- -abc
删除: rm "a b" rm -- -abc
技能用i节点
ls -i
find . -inum 16
find . -inum -exec rm {} \;
linux独有unix没有
loacte
locate filename
locate 在文件目录数据库查找非常快,但是系统目录文件数据库没有更新就找不到
,find是在根目录下搜索,系统有计划任务定期执行updatedb
文件搜索命令grep
文件纸搜索字符串匹配的行并输出
grep 关键字 filename