如何在 Linux 系统上查看打开的文件句柄是否可写?

kcl*_*air 2 linux lsof

我可以用 lsof 看到一个进程有一个特定文件的打开文件句柄,但是有没有办法可以看到它是什么类型的文件句柄(例如:r,rw)?

Den*_*ker 5

lsof 联机帮助页

  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.
Run Code Online (Sandbox Code Playgroud)

所以在行

liferea    3264    dennis    0r   CHR    1,3    0t0     1049 /dev/null
Run Code Online (Sandbox Code Playgroud)

可以看到 stdin 以只读模式打开