符号如=,*和|是什么 在“ls -F”的输出中是什么意思?

我正在创建一个shell命令的“备忘单”。 我目前正在研究ls命令及其标志。 对于-F标志,我知道大多数附加指标的意思,但是; =| 我找不到任何信息。

有人可以告诉我这些命令是什么意思。

我相信你在谈论ls -F提出的指标 。 从ls的联机帮助页:

 -F, --classify append indicator (one of */=>@|) to entries [...] --indicator-style=WORD append indicator with style WORD to entry names: none (default), slash (-p), file-type (--file-type), classify (-F) 

为了概述这些指标的含义,我们必须深入到联机帮助页底部建议的info页面( info coreutils 'ls invocation' ):

 `-F' `--classify' `--indicator-style=classify' Append a character to each file name indicating the file type. Also, for regular files that are executable, append `*'. The file type indicators are `/' for directories, `@' for symbolic links, `|' for FIFOs, `=' for sockets, `>' for doors, and nothing for regular files. Do not follow symbolic links listed on the command line unless the `--dereference-command-line' (`-H'), `--dereference' (`-L'), or `--dereference-command-line-symlink-to-dir' options are specified. 

以上是摘自“常规输出格式”部分的摘录。 使用info coreutils 'General output formatting'直接转到那里。

TL; DR

  • *用于可执行文件
  • /目录
  • @用于符号链接
  • | 对于FIFO
  • =对于套接字
  • >用于门
  • (没有)常规文件