Questions tagged [lsof]
lsof is a tool to list open files of processes
231 questions
4 votes
2 answers
545 views
how to tell, from the outside, if the output stream of a process has been closed?
Suppose you have this script, on an Ubuntu machine: #!/bin/env python3 import sys import time try: i = 1 while True: print(i) i += 1 except Exception as e: sys.stderr.write(f"We ...
0 votes
2 answers
150 views
Killing a process PID starts a new process instead
I have a running process on localhost on port 5000. I have tried kill - 9 <PID> which it works for that PID but it starts a new process with a new PID instead. What's the issue here? I'll put ...
0 votes
1 answer
65 views
Detecting outbound mail
My VMs IPv6 address occasionally get on a blocklist. Their "evidence" is that they claim something is making outbound connections to port 25 and issuing an EHLO of an IP address, not a ...
0 votes
0 answers
70 views
ps ax and -o fd
According to ps(1), ps doesn't support fd. even I didn't find fd in task_struct of kernel. How can I find fd of a program? َUPDATE: FD means File Descriptor. When I get query from services such as : ...
0 votes
1 answer
41 views
freeciv in lsof output
I'm working an issue with ZeroMQ using XSub-XPub. I did lsof on bind in port and see: lsof -i :5556 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python 475590 codespace 45u IPv4 ...
0 votes
1 answer
284 views
Hundreds of strange connections in iftop
OS is Debian. I'm running nginx as a webserver. I am not running Wordpress. Logging is enabled in the http block with: access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; ...
0 votes
2 answers
357 views
Process called lsof using too much CPU
I keep having lsof -w -l +d /var/lib/php5 eating up my CPU I want to know who is triggering it and what does it have with php5 ...
0 votes
0 answers
86 views
Very large discrepancy between du and df
OS is Debian. I have a few systems that seem to not be freeing disk space correctly. On a normal system: du --max-depth 1 / --exclude=/proc -h -x Seems to almost exactly agree with: df -h / ie, ~800 ...
2 votes
2 answers
464 views
Finding the processes trying to open some FIFO
In my example, the wc program is trying to open the test FIFO or named pipe. These in-progress open syscalls seem not to be shown by fuser or lsof: mknod /tmp/testpipe p wc /tmp/testpipe & timeout ...
1 vote
1 answer
376 views
Why ss show a port is in use but lsof doesn't?
When I use ss (socket statistics) to show the usages of port 5432 I get: $ sudo ss -ln | grep -E 'State|5432' Netid State Recv-Q Send-Q Local Address:Port Peer Address:...
4 votes
1 answer
163 views
lsof output file descriptor with asterisk not documented
When I run lsof I see the output java 1752736 user 9995u sock 0,8 0t0 1432559505 protocol: TCPv6 java 1752736 ...
0 votes
1 answer
748 views
fuser -v /dev/nvidia* and lsof not responding
On our A100 machine, we frequently have zombie processes that still allocate memory when already stopped. I usually used fuser -v /dev/nvidia* to determine the PIDs of all processes and kill them ...
2 votes
1 answer
275 views
Have lsof take action if a process has a file open — and, ideally, do so repeatedly
Per the EXAMPLES section in the lsof(8) man page on manpages.ubuntu.com, I should be able to run a command/take action if a process has a file open: To take action only if a process has /u/abe/foo ...
0 votes
1 answer
255 views
How can I find out what so_type an existing unix socket has in macOS?
In linux we can run ss -x or lsof -U +E and we can see what type unix socket has. But in macOS there is no ss or we can run lsof -U which only shows TYPE - unix, but I would like to know with some ...
0 votes
1 answer
565 views
how can I list, with lsof command, TCP Established connections ignoring localhost?
Using lsof command I would like to print out TCP connections with ESTABLISHED state but ignoring the ones with localhost. I tried: lsof -itcp@^127.0.0.1 -stcp:established lsof -itcp@(^127.0.0.1) -stcp:...