【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将文件的每一行作为一个单位,相互比较,比 ...
随机推荐
- Java-->多线程复制(文件指针)
--> 这里用到两种方法...其实也不算两种,就一点点不一样而已... ---> Test 测试类 package com.dragon.java.multithreadcopy; imp ...
- 转载:奇异值分解(SVD) --- 线性变换几何意义(下)
本文转载自他人: PS:一直以来对SVD分解似懂非懂,此文为译文,原文以细致的分析+大量的可视化图形演示了SVD的几何意义.能在有限的篇幅把这个问题讲解的如此清晰,实属不易.原文举了一个简单的图像处理 ...
- UVa 1593代码对齐
原题链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem ...
- leetcode 143. Reorder List ----- java
Given a singly linked list L: L0→L1→-→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→- You must do thi ...
- IOS&swift开发常用的网站
swift转OC:http://iswift.org/try OC转swift:https://www.myappconverter.com/ swift语言视频:http://space.bilib ...
- console下纯字符实现的俄罗斯方块
忙里偷闲,消遣一下,先上一张寒酸的效果图: 废话不多说,直接上代码,win7 64 code blocks编译通过. 吐槽一下cb的watch功能实在不够友好,不过免费的也不能要求太高. [按键说明] ...
- 排序算法总结(一)插入排序【Insertion Sort】
最近在忙着找工作,以前看的排序算法都忘记了,悲剧啦T T现在来回顾一下吧. 这边推荐一个算法可视化的网站,非常有用.http://visualgo.net/ 一.插入排序的思想(Wikipedia) ...
- dedecms的特性-----不完整
1.前后台分离彻底,连模板引擎都不同 2.多入口,但使用相同的基类--------每个入口都清晰
- vb6中webbrowser控件树转换备忘
Dim doc As HTMLDocument Set doc = WebBrowser1.Document Dim inputs As IHTMLElementCollection Set inpu ...
- 二十四种设计模式:外观模式(Facade Pattern)
外观模式(Facade Pattern) 介绍为子系统中的一组接口提供一个一致的界面,Facade模式定义了一个高层接口,这个接口使得这一子系统更加容易使用.示例有一个Message实体类,某对象对它 ...