mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-18 13:11:20 +08:00
doc: update find.md (#148) 436e73a3a9
This commit is contained in:
120
CONTRIBUTORS.svg
120
CONTRIBUTORS.svg
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 2.2 MiB |
@ -40,7 +40,7 @@
|
||||
<p>这是 Linux find 命令备忘清单的快速参考列表,包含常用选项和示例。</p>
|
||||
</div></header><div class="menu-tocs"><div class="menu-btn"><svg aria-hidden="true" fill="currentColor" height="1em" width="1em" viewBox="0 0 16 16" version="1.1" data-view-component="true">
|
||||
<path fill-rule="evenodd" d="M2 4a1 1 0 100-2 1 1 0 000 2zm3.75-1.5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zm0 5a.75.75 0 000 1.5h8.5a.75.75 0 000-1.5h-8.5zM3 8a1 1 0 11-2 0 1 1 0 012 0zm-1 6a1 1 0 100-2 1 1 0 000 2z"></path>
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#用法">用法</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#参数示例">参数示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#类型">类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#大小">大小</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#大小--">大小 +/-</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#名称">名称</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#权限">权限</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#所有者和组">所有者和组</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多个文件名">多个文件名</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多个目录">多个目录</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#空的">空的</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#查找日期和时间">查找日期和时间</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#方法">方法</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#示例">示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#更多示例">更多示例</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#查找并">查找并</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和删除">查找和删除</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和替换">查找和替换</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和重命名">查找和重命名</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和移动">查找和移动</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和复制">查找和复制</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找并连接">查找并连接</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和排序">查找和排序</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和-chmod">查找和 chmod</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找并-tar">查找并 tar</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</svg></div><div class="menu-modal"><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#入门">入门</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#用法">用法</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#参数示例">参数示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#类型">类型</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#大小">大小</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#大小--">大小 +/-</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#名称">名称</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#权限">权限</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#所有者和组">所有者和组</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多个文件名">多个文件名</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#多个目录">多个目录</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#空的">空的</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#查找日期和时间">查找日期和时间</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#方法">方法</a><a aria-hidden="true" class="leve4 tocs-link" data-num="4" href="#示例">示例</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#更多示例">更多示例</a><a aria-hidden="true" class="leve2 tocs-link" data-num="2" href="#查找并">查找并</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和删除">查找和删除</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和替换">查找和替换</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和重命名">查找和重命名</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和移动">查找和移动</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和复制">查找和复制</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找并连接">查找并连接</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和排序">查找和排序</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找和-chmod">查找和 chmod</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找并-tar">查找并 tar</a><a aria-hidden="true" class="leve3 tocs-link" data-num="3" href="#查找并排除目录">查找并排除目录</a></div></div><div class="h1wrap-body"><div class="wrap h2body-exist"><div class="wrap-header h2wrap"><h2 id="入门"><a aria-hidden="true" tabindex="-1" href="#入门"><span class="icon icon-link"></span></a>入门</h2><div class="wrap-body">
|
||||
</div></div><div class="h2wrap-body"><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="用法"><a aria-hidden="true" tabindex="-1" href="#用法"><span class="icon icon-link"></span></a>用法</h3><div class="wrap-body">
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token punctuation">[</span>path<span class="token punctuation">..</span>.<span class="token punctuation">]</span> <span class="token punctuation">[</span>options<span class="token punctuation">]</span> <span class="token punctuation">[</span>expression<span class="token punctuation">]</span>
|
||||
</span></code></pre>
|
||||
@ -251,10 +251,10 @@
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> /home <span class="token parameter variable">-user</span> tecmint <span class="token parameter variable">-iname</span> <span class="token string">"*.txt"</span>
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="多个文件名"><a aria-hidden="true" tabindex="-1" href="#多个文件名"><span class="icon icon-link"></span></a>多个文件名</h3><div class="wrap-body">
|
||||
<pre class="wrap-text "><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token punctuation">\</span><span class="token punctuation">(</span> <span class="token parameter variable">-name</span> <span class="token string">"*.sh"</span> <span class="token parameter variable">-o</span> <span class="token parameter variable">-name</span> <span class="token string">"*.txt"</span> <span class="token punctuation">\</span><span class="token punctuation">)</span>
|
||||
<pre class="wrap-text "><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token punctuation">\</span><span class="token punctuation">(</span> <span class="token parameter variable">-name</span> <span class="token string">"*.sh"</span> <span class="token parameter variable">-or</span> <span class="token parameter variable">-name</span> <span class="token string">"*.txt"</span> <span class="token punctuation">\</span><span class="token punctuation">)</span>
|
||||
</span></code></pre>
|
||||
<!--rehype:className=wrap-text -->
|
||||
<p>查找带有 <code>.sh</code> 和 <code>.txt</code> 扩展名的文件</p>
|
||||
<p>查找带有 <code>.sh</code> 或 <code>.txt</code> 扩展名的文件</p>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="多个目录"><a aria-hidden="true" tabindex="-1" href="#多个目录"><span class="icon icon-link"></span></a>多个目录</h3><div class="wrap-body">
|
||||
<pre class="wrap-text "><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> /opt /usr /var <span class="token parameter variable">-name</span> foo.scala <span class="token parameter variable">-type</span> f
|
||||
</span></code></pre>
|
||||
@ -422,6 +422,10 @@
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token parameter variable">-name</span> <span class="token string">"*.java"</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">tar</span> cvf myfile.tar
|
||||
</span><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token parameter variable">-name</span> <span class="token string">"*.java"</span> <span class="token operator">|</span> <span class="token function">xargs</span> <span class="token function">tar</span> rvf myfile.tar
|
||||
</span></code></pre>
|
||||
</div></div></div><div class="wrap h3body-not-exist"><div class="wrap-header h3wrap"><h3 id="查找并排除目录"><a aria-hidden="true" tabindex="-1" href="#查找并排除目录"><span class="icon icon-link"></span></a>查找并排除目录</h3><div class="wrap-body">
|
||||
<p>查找当前目录及子目录中的所有<code>js</code>文件,但是排除掉<code>node_modules</code>目录中的</p>
|
||||
<pre class="language-shell"><code class="language-shell code-highlight"><span class="code-line">$ <span class="token function">find</span> <span class="token builtin class-name">.</span> <span class="token parameter variable">-type</span> f <span class="token parameter variable">-name</span> <span class="token string">"*.js"</span> <span class="token parameter variable">-not</span> <span class="token parameter variable">-path</span> <span class="token string">"./node_modules/*"</span>
|
||||
</span></code></pre>
|
||||
</div></div></div></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang.</footer></footer><script>
|
||||
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
|
||||
window.onhashchange = function () {
|
||||
|
@ -532,6 +532,9 @@
|
||||
<a href="https://github.com/13812700839" title="花殇">
|
||||
<img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇">
|
||||
</a>
|
||||
<a href="https://github.com/sjh42" title="42:p">
|
||||
<img src="https://avatars.githubusercontent.com/u/34529275?v=4" width="42;" alt="42:p">
|
||||
</a>
|
||||
<a href="https://github.com/Smartdousha" title="Anko">
|
||||
<img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="Anko">
|
||||
</a>
|
||||
@ -550,6 +553,9 @@
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang">
|
||||
<img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang">
|
||||
</a>
|
||||
<a href="https://github.com/JeffersonHuang" title="Jefferson">
|
||||
<img src="https://avatars.githubusercontent.com/u/47512530?v=4" width="42;" alt="Jefferson">
|
||||
</a>
|
||||
<a href="https://github.com/JetSquirrel" title="JetSquirrel">
|
||||
<img src="https://avatars.githubusercontent.com/u/20291255?v=4" width="42;" alt="JetSquirrel">
|
||||
</a>
|
||||
@ -639,7 +645,7 @@
|
||||
<!--rehype:class=home-card&style=margin:1.2rem 0;display: flex;justify-content: center;-->
|
||||
<p>如果你有资源,可以很方便部署 web 版,这非常简单,只需要克隆 gh-pages 分支代码到你的静态服务就可以了,还可以使用 <a href="https://hub.docker.com/r/wcjiang/reference">docker</a> 快捷部署 web 版。</p>
|
||||
|
||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2022/11/19 22:23:32</footer></footer><script>
|
||||
</div></div><div class="h2wrap-body"></div></div></div></div><footer class="footer-wrap"><footer class="max-container">© 2022 Kenny Wang. Updated on 2022/11/20 02:48:46</footer></footer><script>
|
||||
if(('onhashchange' in window) && ((typeof document.documentMode==='undefined') || document.documentMode==8)) {
|
||||
window.onhashchange = function () {
|
||||
anchorPoint()
|
||||
|
Reference in New Issue
Block a user