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命令详解的更多相关文章

  1. linux awk命令详解

    linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...

  2. linux cat 命令详解

    linux cat 命令详解 http://linux.chinaunix.net/techdoc/system/2007/11/16/972467.shtml adb shell su //这个不一 ...

  3. 【初级】linux rm 命令详解及使用方法实战

    rm:删除命令 前言: windows中的删除命令大家都不陌生,linux中的删除命令和windows中有一个共同特点,那就是危险,前两篇linux mkdir 命令详解及使用方法实战[初级]中我们就 ...

  4. Linux netstat命令详解

    Linux netstat命令详解 一  简介 Netstat 命令用于显示各种网络相关信息,如网络连接,路由表,接口状态 (Interface Statistics),masquerade 连接,多 ...

  5. linux grep命令详解

    linux grep命令详解 简介 grep (global search regular expression(RE) and print out the line,全面搜索正则表达式并把行打印出来 ...

  6. Linux chmod命令详解

    Linux chmod命令详解 chmod----改变一个或多个文件的存取模式(mode)   chmod [options] mode files   只能文件属主或特权用户才能使用该功能来改变文件 ...

  7. 【转发】linux yum命令详解

    linux yum命令详解 yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理, ...

  8. linux iostat命令详解 磁盘操作监控工具

    Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视. 它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况. ...

  9. linux yum 命令 详解

    linux yum命令详解 yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能 ...

  10. linux sort 命令详解(转 )

    linux sort 命令详解 sort是在Linux里非常常用的一个命令,管排序的,集中精力,五分钟搞定sort,现在开始! 1 sort的工作原理 sort将文件的每一行作为一个单位,相互比较,比 ...

随机推荐

  1. 常用http请求状态码含义

    1**  ----临时响应 2**  ----成功响应 3**  ----重定向 4**  ----请求错误 5**  ----服务器错误 常用的几个如下: 200---服务器成功返回网页 301-- ...

  2. javascript 中 typeof 的使用

    javascript 中 typeof 的使用 javascript有五种基本的数据类型(简单数据类型),它们分别是:String.Undefined.Null.Boolean和Number.还有一种 ...

  3. 用js实现a链接跳转

    给listxqbottom div添加a跳转链接 <div class="listxqbottom" onclick="location.href='www.bai ...

  4. jQuery显示隐藏动态效果的几种写法

    <script type="text/javascript"> $(document).ready(function() {     /*$("#test1& ...

  5. phpwind8.7升级9.0.1过程(四)20130207升级到20141228

    每一次升级前都要注意备份 1.网站根目录的所有文件 2.网站的数据库 根据phpwind官方教程 更新到20130702版本成功并备份 更新到20140428版本成功并备份 20141228版本的更新 ...

  6. <C Traps and Pitfalls>笔记

    //------------------------------------------------------------------------------ 2.1 理解函数的声明: 编写一个独立 ...

  7. java多线程机制

    多线程使用场景 1.同时需要做两件以上事情时需要开多个线程(例如:上传功能附带进度条显示,一边做上传,一边更新进度条状态.) 2.大量同类型数据需要进行处理(导入导出大量数据) 3.office文档转 ...

  8. The differences between Java EE components and "standard" Java classes

    https://docs.oracle.com/javaee/7/tutorial/overview003.htm ava EE components are written in the Java ...

  9. Xcode 7安装KSImageNamed失败解决方法

    ## How do I use it? Build the KSImageNamed target in the Xcode project and the plug-in will automati ...

  10. 一个不错的vim配置

    set nocp set backspace=indent,eol,start set number set autoindent set nocompatible set bs=indent,eol ...