uTools-Manuals/docs/linux/slocate.html
2019-04-21 11:50:48 +08:00

25 lines
1.5 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<h1 id="slocate">slocate</h1>
<p>命令查找文件或目录</p>
<h2 id="补充说明">补充说明</h2>
<p><strong>slocate命令</strong> 是一个命令查找文件或目录。slocate本身具有一个数据库里面存放了系统中文件与目录的相关信息。</p>
<h3 id="语法">语法</h3>
<pre><code class="language-bash">slocate [-u][--help][--version][-d &lt;目录&gt;][查找的文件]</code></pre>
<h3 id="选项">选项</h3>
<pre><code class="language-bash">-d&lt;目录&gt;或--database=&lt;目录&gt;  指定数据库所在的目录。
-u  更新slocate数据库。
--help  显示帮助。
--version  显示版本信息。</code></pre>
<h3 id="实例">实例</h3>
<p>使用指令“slocate”显示文件名中含有关键字“fdisk”的文件路径信息输入如下命令</p>
<pre><code class="language-bash">$ slocate fdisk #显示文件名中含有fdisk关键字的文件的路径信息 </code></pre>
<p>执行以上命令后,指令执行的输出信息如下:</p>
<pre><code class="language-bash">$ slocate fdisk #显示文件名中含有fdisk 关键字的文件的路径信息
/root/cfdisk #搜索到的文件路径列表
/root/fdisk
/root/sfdisk
/usr/include/grub/ieee1275/ofdisk.h
/usr/share/doc/util-Linux/README.cfdisk
/usr/share/doc/util-Linux/README.fdisk.gz
/usr/share/doc/util-Linux/examples/sfdisk.examples.gz </code></pre>
<!-- Linux命令行搜索引擎https://jaywcjlove.github.io/linux-command/ -->