⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 linux文件查找命令find,xargs详述 linuxsir_org.htm

📁 linuxSir 网站的精华文章
💻 HTM
📖 第 1 页 / 共 4 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0040)http://www.linuxsir.org/main/?q=node/137 -->
<HTML lang=zh-hans xml:lang="zh-hans" 
xmlns="http://www.w3.org/1999/xhtml"><HEAD><TITLE>Linux文件查找命令find,xargs详述 | LinuxSir.Org</TITLE>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<STYLE type=text/css media=all>@import url( misc/drupal.css );
</STYLE>



<STYLE type=text/css media=all>@import url( modules/taxonomy_context/taxonomy_context.css );
</STYLE>
<LINK media=screen 
href="Linux文件查找命令find,xargs详述  LinuxSir_Org.files/menuExpandable3.css" 
type=text/css rel=stylesheet>
<SCRIPT src="Linux文件查找命令find,xargs详述  LinuxSir_Org.files/menuExpandable3.js" 
type=text/javascript></SCRIPT>
<LINK href="Linux文件查找命令find,xargs详述  LinuxSir_Org.files/common.css" 
type=text/css rel=stylesheet>
<STYLE type=text/css media=all>@import url( themes/chameleon/marvin/style.css );
</STYLE>

<META content="MSHTML 6.00.2900.2180" name=GENERATOR></HEAD>
<BODY>
<DIV id=header><A title=Home href="http://www.linuxsir.org/main/"><IMG alt=Home 
src="Linux文件查找命令find,xargs详述  LinuxSir_Org.files/logo.jpg"></A></DIV>
<DIV class=navlinks>
<DIV class=primary><A href="http://www.linuxsir.org/main/?q"><FONT 
color=white>首页</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=taxonomy/term/34"><FONT 
color=white>事件</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=taxonomy/term/1/25/"><FONT 
color=white>文档</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=taxonomy/term/35/48/"><FONT 
color=white>资源</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=search"><FONT color=white>搜索</FONT></A> | 
<A href="http://www.linuxsir.org/bbs"><FONT color=white>论坛</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=taxonomy/term/38"><FONT 
color=white>贡献者</FONT></A> | <A 
href="http://www.linuxsir.org/main/?q=node/3"><FONT color=white>关于</FONT></A> | 
<A href="http://www.linuxsir.org/main/?q=user"><FONT 
color=white>注册/登录</FONT></A></DIV></DIV>
<TABLE id=content>
  <TBODY>
  <TR>
    <TD id=sidebar-left>
      <DIV class="block block-block" id=block-block-1>
      <H2 class=title>子站索引</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://fedora.linuxsir.org/" target?_blank?>Fedora中文</A> 
        <LI><A href="http://debian.linuxsir.org/" target?_blank?>Debian中文</A> 
        <LI><A href="http://lfs.linuxsir.org/" target?_blank?>LFS 中文</A> 
        <LI><A href="http://slack.linuxsir.org/">Slackware</A> 
        <LI><A href="http://gentoo.linuxsir.org/">Gentoo中文</A> 
        <LI><A href="http://arch.linuxsir.org/">Arch 中文</A> </LI></UL></DIV></DIV>
      <DIV class="block block-block" id=block-block-3>
      <H2 class=title>重要资讯</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/36">本站公告</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/34">新闻事件</A> 
        <LI><A href="http://www.linuxsir.org/bbs" target=_blank>本站论坛</A> 
        <LI><A href="http://www.linuxsir.org/main/?q=taxonomy/term/38">贡 献 者</A> 
        </LI></UL></DIV></DIV>
      <DIV class="block block-block" id=block-block-7>
      <H2 class=title>项目索引</H2>
      <DIV class=content>
      <UL>
        <LI><A href="http://www.fcitx.org/" target=_blank>小企鹅输入法</A> 
        <LI><A href="http://lumaqq.linuxsir.org/" target=_blank>LumaQQ</A> 
        <LI><A href="http://openq.linuxsir.org/" target=_blank>OpenQ</A> 
        <LI><A href="http://www.relaxbsd.org/" target=_blank>RelaxBSD</A> 
      </LI></UL></DIV></DIV>
      <DIV class="block block-user" id=block-user-1>
      <H2 class=title>站点导航</H2>
      <DIV class=content>
      <DIV class=menu>
      <UL>
        <LI class=leaf><A title=注册/登录 
        href="http://www.linuxsir.org/main/?q=user">注册/登录</A> 
        <LI class=collapsed><A 
        href="http://www.linuxsir.org/main/?q=aggregator">新闻聚合</A> 
      </LI></UL></DIV></DIV></DIV>
      <DIV class="block block-aggregator" id=block-aggregator-feed-2>
      <H2 class=title>LinuxSir.Org 论坛</H2>
      <DIV class=content>
      <DIV class=item-list>
      <UL>
        <LI><A 
        href="http://www.linuxsir.org/bbs/showthread.php?t=267815&amp;goto=newpost">w3m 
        支持代理吗?怎么设置呢?</A> 
        <LI><A 
        href="http://www.linuxsir.org/bbs/showthread.php?t=267814&amp;goto=newpost">求Hiweed-Debian 
        0.6的内核文件</A> 
        <LI><A 
        href="http://www.linuxsir.org/bbs/showthread.php?t=267813&amp;goto=newpost">[求助]显卡设置问题,热心人请进。</A> 

        <LI><A 
        href="http://www.linuxsir.org/bbs/showthread.php?t=267812&amp;goto=newpost">redflag5驱动装不上(n61g主板)?</A> 

        <LI><A 
        href="http://www.linuxsir.org/bbs/showthread.php?t=267811&amp;goto=newpost">有人用tetex吗?问个问题</A> 
        </LI></UL></DIV>
      <DIV class=more-link><A title=查看此feed的最新消息 
      href="http://www.linuxsir.org/main/?q=aggregator/sources/2">更多</A></DIV></DIV></DIV>
      <DIV class="block block-user" id=block-user-2>
      <H2 class=title>最新注册</H2>
      <DIV class=content>
      <DIV class=item-list>
      <UL>
        <LI>nda36
        <LI>rockeyes
        <LI>sapphire.jxy
        <LI>小哼同学
        <LI>adpis</LI></UL></DIV></DIV></DIV>
      <DIV class="block block-user" id=block-user-3>
      <H2 class=title>当前在线</H2>
      <DIV class=content>0 users 和 54 游客 在线</DIV></DIV></TD>
    <TD id=main>
      <DIV class=breadcrumb><A href="http://www.linuxsir.org/main/?q=">首页</A> » 
      <A href="http://www.linuxsir.org/main/?q=taxonomy/term/1">Linux</A></DIV>
      <H2>Linux文件查找命令find,xargs详述</H2><!-- begin content -->
      <DIV class=node>
      <DIV class=content>
      <P><B>总结:</B><A href="http://www.linuxsir.org/bbs/member.php?u=57037" 
      target=_blank>zhy2111314</A><BR><B>来自:</B>LinuxSir.Org<BR><B>整理:</B>北南南北<BR><B>摘要:</B> 
      本文是find 
      命令的详细说明,可贵的是针对参数举了很多的实例,大量的例证,让初学者更为容易理解;本文是zhyfly兄贴在论坛中;我对本文进行了再次整理,为方便大家阅读;</P>
      <P><FONT size=4><B>目录</B></FONT></P>
      <P><A 
      href="http://www.linuxsir.org/main/?q=node/137#0"><B>版权声明</B></A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/137#00"><B>前言:关于find命令</B></A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/137#1"><B><BR>一、find 
      命令格式<BR></B></FONT></P>
      <UL><A 
        href="http://www.linuxsir.org/main/?q=node/137#1.1">1、find命令的一般形式为;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#1.2">2、find命令的参数;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#1.3">3、find命令选项;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#1.4">4、使用exec或ok来执行shell命令;</A> 
      </UL>
      <P><A 
      href="http://www.linuxsir.org/main/?q=node/137#2"><B>二、find命令的例子;</B></A></P>
      <UL><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.1">1、查找当前用户主目录下的所有文件;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.2">2、为了在当前目录中文件属主具有读、写权限,并且文件所属组的用户和其他用户具有读权限的文件;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.3">3、为了查找系统中所有文件长度为0的普通文件,并列出它们的完整路径;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.4">4、查找/var/logs目录中更改时间在7日以前的普通文件,并在删除之前询问它们;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.5">5、为了查找系统中所有属于root组的文件;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.6">6、find命令将删除当目录中访问时间在7日以来、含有数字后缀的admin.log文件</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.7">7、为了查找当前文件系统中的所有目录并排序;</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#2.8">8、为了查找系统中所有的rmt磁带设备;</A> 
      </UL>
      <P><A 
      href="http://www.linuxsir.org/main/?q=node/137#3"><B>三、xargs</B></A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/137#4"><B>四、find 
      命令的参数;</B></A></P>
      <UL><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.1">1、使用name选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.2">2、用perm选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.3">3、忽略某个目录</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.4">4、使用find查找文件的时候怎么避开某个文件目录</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.5">5、使用user和nouser选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.6">6、使用group和nogroup选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.7">7、按照更改时间或访问时间等查找文件</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.8">8、查找比某个文件新或旧的文件</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.9">9、使用type选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.10">10、使用size选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.11">11、使用depth选项</A><BR><A 
        href="http://www.linuxsir.org/main/?q=node/137#4.12">12、使用mount选项</A> 
</UL>
      <P><A 
      href="http://www.linuxsir.org/main/?q=node/137#5"><B>五、关于本文</B></A><BR><A 
      href="http://www.linuxsir.org/main/?q=node/137#5"><B>六、相关文档</B></A></P>
      <P><FONT 
      color=blue><B><BR>+++++++++++++++++++++++++++++++++++++++++++++++++<BR>正文<BR>+++++++++++++++++++++++++++++++++++++++++++++++++<BR></B></FONT></P>
      <P><FONT id=0 size=4><B><BR>版权声明<BR></B></FONT></P>
      <P>本文是zhyfly兄贴在LinuxSir.Org 
      的一个帖子而整理出来的,如果您对版权有疑问,请在本帖后面跟帖。谢谢;本文的HTML版本由北南南北整理;修改了整篇文档的全角及说明文字中的单词中每个字母空格的问题;为标题加了编号,方便大家阅读;</P>
      <P><FONT id=00 size=4><B>前言:关于find命令</B></FONT></P>
      <P>由于find具有强大的功能,所以它的选项也很多,其中大部分选项都值得我们花时间来了解一下。即使系统中含有网络文件系统( 
      NFS),find命令在该文件系统中同样有效,只你具有相应的权限。</P>
      <P>在运行一个非常消耗资源的find命令时,很多人都倾向于把它放在后台执行,因为遍历一个大的文件系统可能会花费很长的时间(这里是指30G字节以上的文件系统)。</P>
      <P><FONT id=1 size=4><B><BR>一、find 命令格式<BR></B></FONT></P>
      <P><FONT id=1.1 size=3><B><BR>1、find命令的一般形式为;<BR></B></FONT></P>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -