mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2025-12-17 00:04:34 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -3,9 +3,9 @@
|
||||
<h2 id="补充说明">补充说明</h2>
|
||||
<p><strong>ls命令</strong> 用来显示目标列表,在Linux中是使用率较高的命令。ls命令的输出信息可以进行彩色加亮显示,以分区不同类型的文件。</p>
|
||||
<h3 id="语法">语法</h3>
|
||||
<pre><code>ls(选项)(参数)</code></pre>
|
||||
<pre><code class="language-bash">ls(选项)(参数)</code></pre>
|
||||
<h3 id="选项">选项</h3>
|
||||
<pre><code>
|
||||
<pre><code class="language-bash">
|
||||
-a, --all 不隐藏任何以. 开始的项目
|
||||
-A, --almost-all 列出除. 及.. 以外的任何项目
|
||||
--author 与-l 同时使用时列出每个文件的作者
|
||||
@@ -107,16 +107,16 @@ SELinux options:
|
||||
<h3 id="参数">参数</h3>
|
||||
<p>目录:指定要显示列表的目录,也可以是具体的文件。</p>
|
||||
<h3 id="实例">实例</h3>
|
||||
<div class="sourceCode" id="cb3"><pre class="sourceCode bash"><code class="sourceCode bash"><a class="sourceLine" id="cb3-1" data-line-number="1">$ <span class="fu">ls</span> # 仅列出当前目录可见文件</a>
|
||||
<div class="sourceCode" id="cb3"><pre><code class="language-bash"><a class="sourceLine" id="cb3-1" data-line-number="1">$ <span class="fu">ls</span> # 仅列出当前目录可见文件</a>
|
||||
<a class="sourceLine" id="cb3-2" data-line-number="2">$ <span class="fu">ls</span> -l # 列出当前目录可见文件详细信息</a>
|
||||
<a class="sourceLine" id="cb3-3" data-line-number="3">$ <span class="fu">ls</span> -hl # 列出详细信息并以可读大小显示文件大小</a>
|
||||
<a class="sourceLine" id="cb3-4" data-line-number="4">$ <span class="fu">ls</span> -al # 列出所有文件(包括隐藏)的详细信息</a></code></pre></div>
|
||||
<p>显示当前目录下包括影藏文件在内的所有文件列表</p>
|
||||
<pre><code>[root@localhost ~]# ls -a
|
||||
<pre><code class="language-bash">[root@localhost ~]# ls -a
|
||||
. anaconda-ks.cfg .bash_logout .bashrc install.log .mysql_history satools .tcshrc .vimrc
|
||||
.. .bash_history .bash_profile .cshrc install.log.syslog .rnd .ssh .viminfo</code></pre>
|
||||
<p>输出长格式列表</p>
|
||||
<pre><code>[root@localhost ~]# ls -1
|
||||
<pre><code class="language-bash">[root@localhost ~]# ls -1
|
||||
|
||||
anaconda-ks.cfg
|
||||
install.log
|
||||
@@ -124,20 +124,20 @@ install.log.syslog
|
||||
satools</code></pre>
|
||||
<p>显示文件的inode信息</p>
|
||||
<p>索引节点(index inode简称为“inode”)是Linux中一个特殊的概念,具有相同的索引节点号的两个文本本质上是同一个文件(除文件名不同外)。</p>
|
||||
<pre><code>[root@localhost ~]# ls -i -l anaconda-ks.cfg install.log
|
||||
<pre><code class="language-bash">[root@localhost ~]# ls -i -l anaconda-ks.cfg install.log
|
||||
2345481 -rw------- 1 root root 859 Jun 11 22:49 anaconda-ks.cfg
|
||||
2345474 -rw-r--r-- 1 root root 13837 Jun 11 22:49 install.log</code></pre>
|
||||
<p>水平输出文件列表</p>
|
||||
<pre><code>[root@localhost /]# ls -m
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -m
|
||||
|
||||
bin, boot, data, dev, etc, home, lib, lost+found, media, misc, mnt, opt, proc, root, sbin, selinux, srv, sys, tmp, usr, var</code></pre>
|
||||
<p>修改最后一次编辑的文件</p>
|
||||
<p>最近修改的文件显示在最上面。</p>
|
||||
<pre><code>[root@localhost /]# ls -t
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -t
|
||||
|
||||
tmp root etc dev lib boot sys proc data home bin sbin usr var lost+found media mnt opt selinux srv misc</code></pre>
|
||||
<p>显示递归文件</p>
|
||||
<pre><code>[root@localhost ~]# ls -R
|
||||
<pre><code class="language-bash">[root@localhost ~]# ls -R
|
||||
.:
|
||||
anaconda-ks.cfg install.log install.log.syslog satools
|
||||
|
||||
@@ -145,7 +145,7 @@ anaconda-ks.cfg install.log install.log.syslog satools
|
||||
black.txt freemem.sh iptables.sh lnmp.sh mysql php502_check.sh ssh_safe.sh
|
||||
</code></pre>
|
||||
<p>打印文件的UID和GID</p>
|
||||
<pre><code>[root@localhost /]# ls -n
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -n
|
||||
|
||||
total 254
|
||||
drwxr-xr-x 2 0 0 4096 Jun 12 04:03 bin
|
||||
@@ -171,7 +171,7 @@ drwxr-xr-x 13 0 0 4096 Jun 11 23:38 usr
|
||||
drwxr-xr-x 19 0 0 4096 Jun 11 23:38 var
|
||||
</code></pre>
|
||||
<p>列出文件和文件夹的详细信息</p>
|
||||
<pre><code>[root@localhost /]# ls -l
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -l
|
||||
|
||||
total 254
|
||||
drwxr-xr-x 2 root root 4096 Jun 12 04:03 bin
|
||||
@@ -197,7 +197,7 @@ drwxr-xr-x 13 root root 4096 Jun 11 23:38 usr
|
||||
drwxr-xr-x 19 root root 4096 Jun 11 23:38 var
|
||||
</code></pre>
|
||||
<p>列出可读文件和文件夹详细信息</p>
|
||||
<pre><code>[root@localhost /]# ls -lh
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -lh
|
||||
|
||||
total 254K
|
||||
drwxr-xr-x 2 root root 4.0K Jun 12 04:03 bin
|
||||
@@ -223,12 +223,12 @@ drwxr-xr-x 13 root root 4.0K Jun 11 23:38 usr
|
||||
drwxr-xr-x 19 root root 4.0K Jun 11 23:38 var
|
||||
</code></pre>
|
||||
<p>显示文件夹信息</p>
|
||||
<pre><code>[root@localhost /]# ls -ld /etc/
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -ld /etc/
|
||||
|
||||
drwxr-xr-x 75 root root 4096 Oct 16 04:02 /etc/
|
||||
</code></pre>
|
||||
<p>按时间列出文件和文件夹详细信息</p>
|
||||
<pre><code>[root@localhost /]# ls -lt
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -lt
|
||||
|
||||
total 254
|
||||
drwxrwxrwt 3 root root 98304 Oct 16 08:53 tmp
|
||||
@@ -254,7 +254,7 @@ drwxr-xr-x 2 root root 4096 May 11 2011 srv
|
||||
drwxr-xr-x 2 root root 4096 Nov 8 2010 misc
|
||||
</code></pre>
|
||||
<p>按修改时间列出文件和文件夹详细信息</p>
|
||||
<pre><code>[root@localhost /]# ls -ltr
|
||||
<pre><code class="language-bash">[root@localhost /]# ls -ltr
|
||||
|
||||
total 254
|
||||
drwxr-xr-x 2 root root 4096 Nov 8 2010 misc
|
||||
@@ -280,12 +280,12 @@ drwxr-xr-x 75 root root 4096 Oct 16 04:02 etc
|
||||
drwxrwxrwt 3 root root 98304 Oct 16 08:54 tmp
|
||||
</code></pre>
|
||||
<p>按照特殊字符对文件进行分类</p>
|
||||
<pre><code>[root@localhost nginx-1.2.1]# ls -F
|
||||
<pre><code class="language-bash">[root@localhost nginx-1.2.1]# ls -F
|
||||
|
||||
auto/ CHANGES CHANGES.ru conf/ configure* contrib/ html/ LICENSE Makefile man/ objs/ README src/
|
||||
</code></pre>
|
||||
<p>列出文件并标记颜色分类</p>
|
||||
<pre><code>[root@localhost nginx-1.2.1]# ls --color=auto
|
||||
<pre><code class="language-bash">[root@localhost nginx-1.2.1]# ls --color=auto
|
||||
|
||||
auto CHANGES CHANGES.ru conf configure contrib html LICENSE Makefile man objs README src</code></pre>
|
||||
<!-- Linux命令行搜索引擎:https://jaywcjlove.github.io/linux-command/ -->
|
||||
|
||||
Reference in New Issue
Block a user