Open bingooyong opened 1 year ago
how to check open file without lsof
Poor man's lsof is to execute
ls -l /proc/[process id]/fd
Still, you need to be root.
查看最高限制数:
cat /proc/sys/fs/file-max
Linux:同时打开文件个数的限制,不同系统,限制也不同。
Show network connections of a process
lsof -i -a -p $(pidof firefox)
Try
lsof -i -a -p $(pidof firefox) From man page:
-i This option selects the listing of files any of whose Internet address matches the address specified in i. If no address is specified, this option selects the listing of all Internet and x.25 (HP-UX) network files. -a AND -p This option excludes or selects the listing of files for the processes whose optional Process IDentification (PID) numbers are in the comma-separated set s - e.g., 123 or 123,^456. (There should be no spaces in the set.)
How to determine the socket connection up time on Linux
find /proc/$pid/fd -lname "socket:\[$inode\]" -printf %t
文件打开树
查看进程打开文件
修改CentOS系统默认的文件数量