linux - lsof 列出的管道的 FD 列是什么意思?

标签 linux shell command file-descriptor lsof

我正在使用以下命令获取管道列表:

lsof | grep PIPE 

我想知道 FD 列的值是什么意思(第 5 个 http://i.imgur.com/KHczptf.png )。我认为 rw 分别表示 readwrite,但是每个后面的数字是什么意思这些字符是什么意思?


我知道 FD 表示文件描述符,我想弄清楚列中显示的值的含义,如 3r、16w、20r 等。

最佳答案

文件不仅以流的形式打开。其中一些在 lsof 的手册中列出:

FD    is the File Descriptor number of the file or:

           cwd  current working directory;
           Lnn  library references (AIX);
           err  FD information error (see NAME column);
           jld  jail directory (FreeBSD);
           ltx  shared library text (code and data);
           Mxx  hex memory-mapped type number xx.
           m86  DOS Merge mapped file;
           mem  memory-mapped file;
           mmap memory-mapped device;
           pd   parent directory;
           rtd  root directory;
           tr   kernel trace file (OpenBSD);
           txt  program text (code and data);
           v86  VP/ix mapped file;

      FD  is  followed  by one of these characters, describing the
      mode under which the file is open:

           r for read access;
           w for write access;
           u for read and write access;
           space if mode unknown and no lock
            character follows;
           '-' if mode unknown and lock
            character follows.

      The mode character is followed by one of these lock  charac-
      ters, describing the type of lock applied to the file:

           N for a Solaris NFS lock of unknown type;
           r for read lock on part of the file;
           R for a read lock on the entire file;
           w for a write lock on part of the file;
           W for a write lock on the entire file;
           u for a read and write lock of any length;
           U for a lock of unknown type;
           x  for an SCO OpenServer Xenix lock on part  of the
      file;
           X for an SCO OpenServer Xenix lock on  the   entire
      file;
           space if there is no lock.

      See  the  LOCKS  section  for  more  information on the lock
      information character.

      The FD column contents constitutes a single field for  pars-
      ing in post-processing scripts.

关于linux - lsof 列出的管道的 FD 列是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25140730/

相关文章:

linux - 通过结束进程来停止 bash 脚本的最佳方法

linux - 如何仅grep包含x和y的内容?

silverlight - 如何在Enter键上激活按钮的Click命令?

linux - 为什么 pkg-config 不在 lib 名称前面输出 "-l"?

arrays - bash 中的数组运算符

linux - 比较不同主机中相同目录的shell脚本

linux - 我如何在 linux 中解析这个字符串?

parse-platform - "Please refrain from creating a Parse project inside another Parse project."

linux - Linux中与结构大小相关的命令是什么

linux - 在另一个终端窗口中恢复停止的进程