lsof list open files
Linux一切皆文件,通过文件不仅可以访问常规数据,还可以访问网络连接(套接字)和硬件,该文件描述符为应用程序与os之间提供了接口.lsof需访问各种特权文件,故需root运行
COMMAND contains the first nine characters of the name of the UNIX command associated with the process. 默认只显示前9个字符
PID is the Process IDentification number of the process.
TID is the task (thread) IDentification number, if task (thread) reporting is supported by the dialect and a task (thread) is being listed.
FD is the File Descriptor number of the file or:
- cwd current working directory
- mem memory mapped file
- rtd root directory
- txt program text (code and data)
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 unknow and no lock
TYPE is the type of the node associated with the file
- IPv4 IPv4 socket
- IPv6 an open IPv6 network file - even if its address is IPv4, mapped in an IPv6 address
- unix UNIX domain socket
- DIR directory
- FIFO FIFO special file
- DEL a linux map file that has been deleted
- CHR a charater special file 字符设备文件
- BLK a block special file 块设备文件
- SOCK a socket of unknown domain
- REG regular file