linux find command information more
查找文件
find ./ -type f
查找目录
find ./ -type d
查找名字为test的文件或目录
find ./ -name test
查找名字符合正则表达式的文件,注意前面的‘.*’(查找到的文件带有目录)
find ./ -regex .*so.*\.gz
查找目录并列出目录下的文件(为找到的每一个目录单独执行ls命令,没有选项-print时文件列表前一行不会显示目录名称)
find ./ -type d -print -exec ls {} \;
查找目录并列出目录下的文件(为找到的每一个目录单独执行ls命令,执行命令前需要确认)
find ./ -type d -ok ls {} \;
查找目录并列出目录下的文件(将找到的目录添加到ls命令后一次执行,参数过长时会分多次执行)
find ./ -type d -exec ls {} +
查找文件名匹配*.c的文件
find ./ -name \*.c
打印test文件名后,打印test文件的内容
find ./ -name test -print -exec cat {} \;
不打印test文件名,只打印test文件的内容
find ./ -name test -exec cat {} \;
查找文件更新日时在距现在时刻二天以内的文件
find ./ -mtime -2
查找文件更新日时在距现在时刻二天以上的文件
find ./ -mtime +2
查找文件更新日时在距现在时刻一天以上二天以内的文件
find ./ -mtime 2
查找文件更新日时在距现在时刻二分以内的文件
find ./ -mmin -2
查找文件更新日时在距现在时刻二分以上的文件
find ./ -mmin +2
查找文件更新日时在距现在时刻一分以上二分以内的文件
find ./ -mmin 2
查找文件更新时间比文件abc的内容更新时间新的文件
find ./ -newer abc
查找文件访问时间比文件abc的内容更新时间新的文件
find ./ -anewer abc
查找空文件或空目录
find ./ -empty
查找空文件并删除
find ./ -empty -type f -print -delete
查找权限为644的文件或目录(需完全符合)
find ./ -perm 664
查找用户/组权限为读写,其他用户权限为读(其他权限不限)的文件或目录
find ./ -perm -664
查找用户有写权限或者组用户有写权限的文件或目录
find ./ -perm /220
find ./ -perm /u+w,g+w
find ./ -perm /u=w,g=w
查找所有者权限有读权限的目录或文件
find ./ -perm -u=r
查找用户组权限有读权限的目录或文件
find ./ -perm -g=r
查找其它用户权限有读权限的目录或文件
find ./ -perm -o=r
查找所有者为lzj的文件或目录
find ./ -user lzj
查找组名为gname的文件或目录
find ./ -group gname
查找文件的用户ID不存在的文件
find ./ -nouser
查找文件的组ID不存在的文件
find ./ -nogroup
查找有执行权限但没有可读权限的文件
find ./ -executable \! -readable
查找文件size小于10个字节的文件或目录
find ./ -size -10c
查找文件size等于10个字节的文件或目录
find ./ -size 10c
查找文件size大于10个字节的文件或目录
find ./ -size +10c
查找文件size小于10k的文件或目录
find ./ -size -10k
查找文件size小于10M的文件或目录
find ./ -size -10M
查找文件size小于10G的文件或目录
find ./ -size -10G
linux find command information more的更多相关文章
- 12 Linux Which Command, Whatis Command, Whereis Command Examples
This Linux tutorial will explain the three "W" commands. The three "W"s are what ...
- learn Linux sed command
learn Linux sed command 一.参考文档: . sed命令详解 http://qifuguang.me/2015/09/21/sed%E5%91%BD%E4%BB%A4%E8%AF ...
- Linux:-bash: ***: command not found
Linux:-bash: ***: command not found,系统很多命令都用不了,均提示没有此命令. 突然之间linux很多命令都用不了,均提示没有此命令. 这应该是系统环境变量出现了问题 ...
- 【Linux】-NO.8.Linux.4.Command.1.001-【Common Command】-
1.0.0 Summary Tittle:[Linux]-NO.8.Linux.4.Command.1.001-[Common Command]- Style:Linux Series:Command ...
- Linux cp command All In One
Linux cp command All In One $ man cp $ cp -h # 强制 $ cp -f # 递归,复制文件夹 $ cp -r demos cp -fr # ./folder ...
- how to using Linux pipe command output another command's help content to a file
how to using Linux pipe command output another command's help content to a file Linux tee > >& ...
- EXPORT Man Information for Linux use COMMAND col
col命令 是一个标准输入文本过滤器,它从标注输入设备读取文本内容,并把内容显示到标注输出设备.在许多UNIX说明文件里,都有RLF控制字符.当我们运用shell特殊字符>和>>,把 ...
- Linux / Unix Command: bunzip2--reference
http://linux.about.com/library/cmd/blcmdl1_bunzip2.htm NAME bzip2, bunzip2 - a block-sorting file co ...
- 10 Linux DIG Command Examples for DNS Lookup--reference
by RAMESH NATARAJAN on FEBRUARY 29, 2012 http://www.thegeekstuff.com/2012/02/dig-command-examples/ D ...
随机推荐
- Eclipse 保存文件时自动格式化代码
很多同学不知道Eclipse有个很有用的功能,就是自动格式源代码的功能,一般大家都是直接Ctrl+Shift+F手动格式化,多浪费时间. 其实Eclipse里已经带有自动格式化功能了,默认是没有代开该 ...
- 开源项目MultiChoiceAdapter详解(二)——MultiChoiceArrayAdapter的使用
MultiChoiceArrayAdapter其实就是可以多选的ArrayAdapter了,ArrayAdpter我们已经很熟悉了.MultiChoiceArrayAdapter这个类是抽象类,所以使 ...
- SQLite中的事务操作
关于SQLite事务可以解决一些问题,比如你要插入两个数据,可以将两个数据作为同一个事务进行插入,这样如果第二个数据错误了,便自动执行回滚操作,第一个数据也不会插入成功,保证了数据的同步! 一.实际的 ...
- [Nginx] Nginx 配置location总结
cp from : https://www.cnblogs.com/coder-yoyo/p/6346595.html location匹配顺序 "="前缀指令匹配,如果匹配成功, ...
- 使用Python读取Mp3的标签信息
什么是ID3 MP3是音频文件最流行的格式,它的全称是 MPEG layer III.但是这种格式不支持对于音频内容的描述信息,包括歌曲名称.演唱者.专辑等等. 因此在1996年,Eric Kemp在 ...
- Java 8函数式接口functional interface的秘密
Java 8函数式接口functional interface的秘密 2014年10月29日 17:52:55 西瓜可乐520 阅读数:3729 目录 [−] JDK 8之前已有的函数式接口 新定 ...
- C# WebBrowser控件使用整理
一.简介 WebBrowser 控件为 WebBrowser ActiveX 控件提供了托管包装. 托管包装使您可以在 Windows 窗体客户端应用程序中显示网页. 使用WebBrowser 控件, ...
- 代理服务器polipo;socks5代理转http代理
安装: brew install polipo 使用: To have launchd start polipo now and restart at login: brew services sta ...
- JVM的内存区域划分(转)
原文链接:JVM的内存区域划分 JVM的内存区域划分 学过C语言的朋友都知道C编译器在划分内存区域的时候经常将管理的区域划分为数据段和代码段,数据段包括堆.栈以及静态数据区.那么在Java语言当中,内 ...
- linux下使用ack进行代码搜索
1.安装 wget http://beyondgrep.com/ack-2.12-single-file sudo mv ack-2.12-single-file /usr/bin/ack sudo ...