【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将文件的每一行作为一个单位,相互比较,比 ...
随机推荐
- 在yii中使用分页
yii中使用分页很方便,如下两种方法: 在控制器中: 1. $criteria = new CDbCriteria(); //new cdbcriteria数据库$criteria->id = ...
- js 中对字符串操作的函数
concat() – 将两个或多个字符的文本组合起来,返回一个新的字符串. indexOf() – 返回字符串中一个子串第一处出现的索引.如果没有匹配项,返回 -1 . charAt() – 返回指定 ...
- 第四部分:python性能技巧
4.1 查询操作为主时,选择字典结构比list结构效率更高 4.2 取list的交集.并集.差集时,可借助set数据结构如listintersection = list(set(lista)& ...
- hdu1712 ACboy needs your help 分组背包
最基础的分组背包~ #include <iostream> #include <cstdio> #include <cstdlib> #include <cs ...
- Linux软件安装管理概述
介绍如何在Linux字符界面下安装软件 课程大纲: 一.软件包管理简介 二.rpm命令管理 三.yum在线管理 四.源码包管理 五.脚本安装包
- Python 基础语法(二)
Python 基础语法(二) --------------------------------------------接 Python 基础语法(一) ------------------------ ...
- Intro to Filtering with Network Monitor 3.0
https://blogs.technet.microsoft.com/netmon/2006/10/17/intro-to-filtering-with-network-monitor-3-0/ h ...
- ORA-12547:TNS:lost contact 问题分析思路
ORA-12547:TNS:lost contact sqlplus无法正常登陆数据库 解决思路如下: 1.查看操作系统内核参数是否无误 [oracle@normal adump]$ ulimit - ...
- 动态加载dll,并创建类对象放入到list中。
private List<IVisualControlsPlug> visualPlugs = new List<IVisualControlsPlug>(); public ...
- 5分钟实现Android中更换头像功能
写在前面:更换头像这个功能在用户界面几乎是100%出现的.通过拍摄照片或者调用图库中的图片,并且进行剪裁,来进行头像的设置.功能相关截图如下: 下面我们直接看看完整代码吧: 1 2 3 4 5 6 7 ...