Unix command that lists the files, sockets, and other file-descriptors that processes have open.
Questions tagged [lsof]
236 questions
0
votes
1 answer
Mailcatcher Error: port 1025 is already in use
I try to start mailcatcher. And I got error: something's use port 1025. Are you already running MailCatcher?
I try this, and similar answers, but, when I execute lsof command, there is nothing in result for this command which use this port, result…

vladadj31
- 3
- 5
0
votes
1 answer
Python : http.server.HTTPServer : How to close ALL opened files?
So basically, I am making an HTTP webhooks server in Python 3 and wanted to add a restart function because shell access is very limited on the server it will be running on.
I found this snippet somewhere on Stack Overflow earlier:
def…

Noah Cardoza
- 158
- 2
- 8
0
votes
1 answer
Using lsof to track files open by script that is run through the command line
I know that I can use lsof to track files opened by running processes, process groups, users, and those open in specific directories, among other example. However I am curious to see if I can trap files that were opened by a program that is not…

n_x_l
- 1,552
- 3
- 17
- 34
0
votes
1 answer
how to find out open file description for linux process?
While runing my go program, i find out so many error such as "too many open files" in the logs, and i just to find out which process run out of the fds, and i run this command:
lsof -n |awk '{print $2}'|sort|uniq -c |sort -nr
it returns the result…

Liqang Liu
- 1,654
- 3
- 12
- 20
0
votes
1 answer
On mac, lsof says a port is not in use, but I can telnet to the port
If I run lsof, it says that this port is not in use. Yet, I can telnet into it and something is listening on that port.
Am I using the wrong command to see what ports are in use? I'd like to kill the process listening on 3306.
± |master ✓| → lsof…

Daniel Kaplan
- 62,768
- 50
- 234
- 356
0
votes
1 answer
Unable to stop appium server programmatically
I am using this command to stop the Appium server :
kill $(lsof -t -i: 10723)
But now it is not working.

akhilesh gulati
- 128
- 8
0
votes
1 answer
Different result when executed from Crontab
I am trying to get the number of open files periodically through crontab using lsof|wc -l.
It always returns zero. It is giving correct result when i run it directly.Any idea about this strange behaviour?Is it related to pipe size as the result can…

KaKa
- 1,543
- 12
- 18
0
votes
0 answers
lsof and limits open file
Maybe someone make clear for me, about how work system limits:
/etc/security/limits.conf
# -
mysql soft nofile 2048
mysql hard nofile 2048
nofile - max number of open file descriptors
lsof -u…

Alarmus
- 11
- 1
- 3
0
votes
1 answer
Docker port forwarding create two processes
From my Docker container I forward the port 8545 as below
ports:
- '127.0.0.1:8545:8545'
And after run the container, if I run lsof -i :8545 it shows me two processes with the same PID.
COMMAND PID USER FD TYPE DEVICE…

DilumN
- 2,889
- 6
- 30
- 44
0
votes
0 answers
To check a particular file is open or close in node.js
I need to check a particular file is open or close in node.js. If a particular file is close then we will rename it. When I run the following command on the terminal(Mac), it is giving me correct results.
lsof +D /Users/amitraj/Documents/traces
But…

Amit Raj
- 1,358
- 3
- 22
- 47
0
votes
2 answers
cassandra disk growth is faster
We have a cassandra docker cluster of 3 nodes, in one of the node the disk space is growing faster. But when we checked the nodetool status shows, it occupied only 561gb
Address Load Tokens Owns Host ID Rack
UN 10.3.1.11 567.68…

ranjith
- 21
- 3
0
votes
0 answers
Get all opened files in folder
I know that there is util lsof which I can use to get a list of all opened files in specified directory.
But I want to get such info from my osx app. Can't find any lsof-like function which I can use. Any osx API that can do the same as it does…

DoN1cK
- 595
- 7
- 22
0
votes
3 answers
lsof "lies" when using options?
I have a problem where my Java application opens too many files. Debugging this issue, I am dependent on using lsof.
However running lsof this way takes too much time (more than one minutt):
lsof |grep "java"
I should be able to run it using the…

Zamra
- 29
- 2
0
votes
0 answers
Make lsof 'always' return control to command line?
Sometimes you are forced to hit Ctrl-C to cancel.
with something like:
lsof -i :80
Other times it returns automatically.
Why is that?
Is there a way to make it always return control without user interaction?

JGFMK
- 8,425
- 4
- 58
- 92
0
votes
2 answers
lsof linux command to count running instances with argument values
I'm using lsof command to run only one instance of setup.sh and it works fine if there are no argument values. But, i needed to pass arguments in setup.sh for e.g.
setup.sh machine1
setup.sh machine2
setup.sh machine3
So if setup.sh machine1…

Jitesh Sojitra
- 3,655
- 7
- 27
- 46