【linux】find命令详解
find命令格式:find [搜索范围][匹配条件]
-name 参数:按照名字查找
[root@andon ~]# find /root -name test ###精确查找
/root/test
/root/.cpan/build/Template-Toolkit-2.26-LlOKAK/t/test
[root@andon ~]# find /root -name test??###模糊查找
/root/.cpan/build/PadWalker-2.2-TvkCqL/t/test.t
/root/.cpan/build/YAML-1.15-LasxIR/t/test.t
/root/.cpan/build/Test-Differences-0.64-QP24fE/t/test.t
/root/.cpan/build/Email-Sender-1.300028-u3FaFt/t/test.t
/root/.cpan/build/Email-Reply-1.204-YAHruY/t/test.t
[root@andon ~]# find /root -name *test* ##模糊查找,查找含有test的单词
find: paths must precede expression: itest
-iname参数:按照不区分名字查找
[root@andon ~]# find /root -iname test ###不区分大小写
/root/TEST
/root/test
-size参数:按照尺寸查找
[root@andon ~]# find /root -size 2048(数据块) ##等于1M
[root@andon ~]# find /root -size +2048 ##大于1M
[root@andon ~]# find /root -size -2048 ## 小于1M ####一个数据块=512字节=0.5KB
####1MB=1024KB=2048数据块
-user参数:按照所属用户查询
[root@andon home]# find /home -user admin ##查询属于admin用户的文件
-group:按照所属组查询
同上
-amin:访问时间access
[root@andon home]# find /home -amin +5 #### 大于5分钟时被访问的文件
[root@andon home]# find /home -amin -5 #### 5分钟内被访问的文件
-cmin:文件更改属性change
用法同amin
-type:按照文件类型查找
[root@andon ~]# find /root -type d ###directory 按照目录查询
[root@andon ~]# find /root -type f ###file 按照文件查询
[root@andon ~]# find /root -type l ###link 按照连接查询
-a:两条件同时满足
[root@andon ~]# find /root -size +20480 -a -size -204800 ##查找同时满足大于10M小于100M的文件
[root@andon ~]# find /root -size +20480 -a -type f ##查找同时满足大于10M且类型为文件
-o:两个条件满足任意一个即可
用法同-a
-inum:根据节点进行搜索
[root@andon ~]# find / -inum 1319562
find: `/proc/23352/task/23352/fd/5': No such file or directory
find: `/proc/23352/task/23352/fdinfo/5': No such file or directory
find: `/proc/23352/fd/5': No such file or directory
find: `/proc/23352/fdinfo/5': No such file or directory
/root/test
【linux】find命令详解的更多相关文章
- linux awk命令详解
linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...
- linux cat 命令详解
linux cat 命令详解 http://linux.chinaunix.net/techdoc/system/2007/11/16/972467.shtml adb shell su //这个不一 ...
- 【初级】linux rm 命令详解及使用方法实战
rm:删除命令 前言: windows中的删除命令大家都不陌生,linux中的删除命令和windows中有一个共同特点,那就是危险,前两篇linux mkdir 命令详解及使用方法实战[初级]中我们就 ...
- Linux netstat命令详解
Linux netstat命令详解 一 简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多 ...
- linux grep命令详解
linux grep命令详解 简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来 ...
- Linux chmod命令详解
Linux chmod命令详解 chmod----改变一个或多个文件的存取模式(mode) chmod [options] mode files 只能文件属主或特权用户才能使用该功能来改变文件 ...
- 【转发】linux yum命令详解
linux yum命令详解 yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理, ...
- linux iostat命令详解 磁盘操作监控工具
Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视. 它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况. ...
- linux yum 命令 详解
linux yum命令详解 yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能 ...
- linux sort 命令详解(转 )
linux sort 命令详解 sort是在Linux里非常常用的一个命令,管排序的,集中精力,五分钟搞定sort,现在开始! 1 sort的工作原理 sort将文件的每一行作为一个单位,相互比较,比 ...
随机推荐
- 程序退出异常_DebugHeapDelete和std::numpunct
前几天程序新加一个功能之后,其中用到了boost的lexical_cast<float>,发现在关闭命令行窗口的时候,程序报错,是程序退出清理时候报的错误. 一开始以为是程序新增的功能有问 ...
- spring和redis的整合-超越昨天的自己系列(7)
超越昨天的自己系列(7) 扯淡: 最近一直在慢慢多学习各个组件,自己搭建出一些想法.是一个涉猎的过程,慢慢意识到知识是可以融汇贯通,举一反三的,不过前提好像是研究的比较深,有了自己的见解.自认为学习 ...
- c 函数及指针学习 4
1数组和指针声明的差别 声明数组:为数组分配内存,为数组名分配内存(指针常量 4个字节) 指针:为指针分配内存(指针变量 4个字节) 1 2 3 4 5 6 7 8 9 10 #include < ...
- HTML DOM部分---事件 windows对象;
<!--DOM操作windows对象操作 对浏览器进行操作document对象操作 对浏览器内页面文件进行操作 window.shuxing;属性调用格式window.fangfa();方法调用 ...
- 服务器启用 FTP
通常使用 vsftpd 作为FTP服务器. 安装 vsftpd: 1.以管理员(root)身份执行以下命令 yum install vsftpd 2.设置开机启动 vsftpd ftp 服务 chkc ...
- 自定义颜色显示的CheckBox
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- Linux驱动设计——字符设备驱动(一)
Linux字符设别驱动结构 cdev结构体 struct cdev { struct kobject kobj; struct module *owner; const struct file_ope ...
- Java——java多态
/* * 多态: * 成员的特点: * 1.成员变量. * 编译时:参开引用型变量所属类中的是否有调用的成员变量, 有:编译通过, 没有 编译失败. * 运行时: 参考引用变量所属的类 ...
- Java设计模式之简单工厂设计模式
简单工厂将业务逻辑部分和界面逻辑部分分离开来,降低了界面逻辑和业务逻辑的耦合度,符合面向对象迪米特法则.下面以一个加法减法运算器为例,各位读者可以自行按照这种设计方式设计出一个小小的运算器. 1.业务 ...
- Flash pixel Bender学习笔记
pixel Bender是指用来创建,编译,测试和导出pixel shader,用于各种flash产品的一个IDE. Pixel Bender是Adobe推出的一个高性能的图像视频处理技术.它能跨平台 ...