我可以用lsof看到一个进程对于一个特定的文件有一个打开的文件句柄,但是有没有一种方法可以看到它是什么types的文件句柄(ex:r,rw)?
从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.
所以在行中
liferea 3264 dennis 0r CHR 1,3 0t0 1049 /dev/null
你可以看到stdin以只读模式打开
没关系,我看到这是lsof的正常输出的一部分:
FD之后是其中一个字符,描述打开文件的模式:
r为读取权限; 写入权限; 你可以读写访问;