ls -alh 是什么意思?

Pic*_*ana 7 man options

我看到人们ls -alh在Linux终端中使用。然而,当我看到手册时,我没有看到-alh(即当我输入时man ls)。

为什么我的手册里没有呢?有人可以解释它的作用吗?

Byt*_*der 20

ls -alh与 相同ls -a -l -h

多个短选项可以这样组合。

以下是这些选项的含义man ls

-a, --all
    do not ignore entries starting with . 

-l
    use a long listing format 

-h, --human-readable
    with -l, print sizes in human readable format (e.g., 1K 234M 2G) 
Run Code Online (Sandbox Code Playgroud)

  • @PichiWuana 人类可读性与字体大小无关。这是关于在列出一兆字节的文件时打印“1M”而不是“1048576”。 (12认同)
  • 当然,对于 HAL9000 可读,我更喜欢使用 `ls -hal`。 (5认同)
  • @PichiWuana *文件和目录*的大小以人类可读的形式打印,而不是以字节为单位(如果它们是大数字,可能难以解析)。 (3认同)
  • 哦……我现在明白了。 (2认同)

Jac*_*ijm 5

-h代表人类可读

正如评论所说,你可以结合简单的参数,如: -alh。顺序无关紧要。

来自man ls

   -h, --human-readable
          with -l and/or -s, print human readable sizes (e.g., 1K 234M 2G)
Run Code Online (Sandbox Code Playgroud)