Unix command that lists the files, sockets, and other file-descriptors that processes have open.
Questions tagged [lsof]
236 questions
1
vote
1 answer
How can I check which process is using an ip/port?
I have a program that occasionally fails to start because an IP/port that it wants to connect to is already in use. How can I programatically check which process is using the port? I can manually run lsof after I notice the failure, but whatever…

Drew
- 12,578
- 11
- 58
- 98
1
vote
1 answer
How to check from within docker for an open file on a mounted dockerhost filesystem/volume
My app, running within its own docker container, needs to check if a file located on a mounted filesystem/volume is still open by another process on the linux dockerhost (not a process within the container of this app).
E.g. my app should only start…

Heiko Gruner
- 11
- 1
1
vote
0 answers
Nexus keep creating deleted file descriptors in /tmp directory makes the system run out of memory
I've installed Nexus repository 3 on Ubuntu 18.04 LTS and it's working find excepted it keep spawning processes with Huge file descriptors which are jar_cache packages. Almost the memories are consuming by Nexus user.
lsof | grep deleted
java …

BTH.S3
- 199
- 1
- 3
- 12
1
vote
2 answers
kill a process on a specific port by name
I have a process running on port 3200, which communicates with other processes on other ports.
I know I can kill a process on a given port by doing kill -9 $(lsof -t -i:3200).
My problem is that the output of lsof also contains the other processes…

Tirafesi
- 1,297
- 2
- 18
- 36
1
vote
1 answer
Find all changes in filesystem done by a process in Linux/Mac?
Let's say I am going to run a Mac program that will be doing some patching in my home directory. The program requires ROOT privileges to run and I don't know for sure what it does indeed because I don't have source code.
How can I see a list of all…

user3732445
- 241
- 1
- 10
1
vote
1 answer
Kill parent of mysqld process on MacOS
I have a Docker machine, and I want it to be able to use port 3306. But that port is already in use.
I don't remember installing MySQL on the host machine, but I've done a lot of dumb things over the years, so there's a good chance I did. I run…

Mayor of the Plattenbaus
- 974
- 3
- 34
- 69
1
vote
0 answers
Lsof shows a lot of opened files for python
Context
I'm running some calculations on network data using a specific library which I have not coded. I have both small datasets (hundreds of rows) and big datasets (up to 10k rows).
Small datasets run fine but large ones take a lot of time not…

gibbone
- 2,300
- 20
- 20
1
vote
2 answers
Is there a way to list open files and order them in ascending order of time modified?
I'm getting Too Many Open Files issue even when I'm closing all files and connections I'm opening and when I've set the soft and hard limit to max available i.e. 65535.
So in order to debug, I'm trying to re-order the output of lsof in terms of…

hckrman
- 136
- 9
1
vote
0 answers
Can I use timeouts in cURL to avoid a connection hang?
In a cron process, I use cURL to get information from an API. Sometimes the cron process freezes/hangs because of an issue with the API connection.
When I do an strace -p pID, the process is just polling an fd resource and then timesout…

ermSO
- 325
- 1
- 2
- 12
1
vote
0 answers
I'm forced to restart Rails Server to update modifications in controller because of Chrome
Normaly, I don't need to restart rails s when I modify something in controller. But now it doesn't longer work. If I only want to add a "puts" line, I need to kill the server, kill Chrome then restart all, it makes me lose a lot of time.
In fact,…

Léon Boutrand
- 81
- 5
1
vote
0 answers
Is there an alternative option to lsof for detecting open files for a process on macOS?
I need to be able to know all of the files a web browser has open (most specifically Google Chrome).
Right now I've only been able to find the results I need with lsof since this is a fairly low-level operating system request. Basically I use lsof…

ylluminate
- 12,102
- 17
- 78
- 152
1
vote
0 answers
Lsof increase every request in wildfly 10
I have a small test with hello world application in JavaEE.
I used wildfly 10 for deploy that app and use postman to execute api hello world. And then I use lsof command for check list open file of wildfly I saw the number increase in every request…

mai danh
- 853
- 8
- 14
1
vote
0 answers
I want to kill a process but zygote relaunches it
I use android and I know the process I want to kill but everytime I kill it the zygote launches it back I don't know what deamon is monitoring the process neither which calls the zygote socket, please help me, internet!
ps faux is not showing…

mranon
- 43
- 5
1
vote
1 answer
lsof shows lots of same file with a device called 0,0
We have begun experiencing outages on a Java application with 'Too many files open' on a soft limit of 2,000. On closer inspection we see hundreds of files that have a device name of 0,0 and are all roughly the same size.
I suspect the device name…

EddieKincaid
- 11
- 1
1
vote
1 answer
Which thread listens to a specific UDP port
I ran:
# lsof | grep 10900
And its output:
MyExecutab 103497 myuser 7u IPv4 985833 0t0 UDP my.example.com:10900
MyExecutab 103497 103498 myuser 7u IPv4 985833 0t0 UDP…

HCSF
- 2,387
- 1
- 14
- 40