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. 使用Jmeter测试MySQL性能——(1)连接配置

    在搭建MySQL集群之后需要测试集群的性能究竟如何,采用Apache的测试工具Jmeter进行测试,本文主要介绍主要实现Jmeter配置连接到MySQL. 安装相应的软件 首先Jmeter是基于Jav ...

  2. linux安装phpredis扩展

    1.下载扩展安装包 wget   https://github.com/nicolasff/phpredis/downloads 2.解压 tar -zxvf nicolasff-phpredis-2 ...

  3. Spring AOP 实现功能权限校验功能

    版权声明:本文为博主原创文章,未经博主允许不得转载.   目录(?)[-] 使用拦截器实现未登录时跳转到登录界面的功能 1 拦截器SecurityInterceptor 2spring-mvcxml拦 ...

  4. 5 款傻瓜式手机 APP 开发工具

    http://www.oschina.net/news/21552/5-app-creators

  5. js部分---函数与递归;

    function (){}//匿名函数 1.function hanshu () { alert("这是我第一个函数"); } hanshu();//调用函数 2.//有参数的函数 ...

  6. java for each 错误

    简而言之,for each 适用于不改变数组,容器元素的场合,如果改变,必须用索引或者iterator. 例如: A[] arrayA = new A[5]; for (A a : arrayA) { ...

  7. UVa 1394 约瑟夫问题的变形

    https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...

  8. leetcode 144. Binary Tree Preorder Traversal ----- java

    Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tr ...

  9. Python Web.py

    安装Web.py root@bt:~# sudo pip install web.py Downloading/unpacking web.py Downloading web.py-0.37.tar ...

  10. HTML文件结构

    转载(http://jingyan.baidu.com/article/75ab0bcbf04a75d6864db2fd.html) HTML文件结构 HTML文件均以<html>标记开始 ...