Unix command that lists the files, sockets, and other file-descriptors that processes have open.
Questions tagged [lsof]
236 questions
0
votes
2 answers
Not able to run grep command
I was trying to run the following instruction in Android (Java):
Process p = Runtime.getRuntime().exec("/system/bin/lsof|grep mediaserver");
but I am getting an error if I run the following instruction:
Process p =…

chiv
- 165
- 1
- 2
- 15
0
votes
1 answer
lsof indicates that my java process is leaking /devices/pseudo/tl@0:ticots
I have a java EE app running in Jboss in Unix and I have noticed that after a couple of days I get "too many open files"
I've identified what is leaking but I have no idea what it actually is or how to find which part of my code that is leaking
my…

Richo
- 751
- 7
- 17
-1
votes
1 answer
Why is nodejs saying the port is in use?
I have the following node.js server:
const main = () => {
log(`Starting server`)
const exit = signal => {
server.close(() => process.exit())
log('Server is closed.')
}
const server = http.createServer(handleRequest)
…

Aaron Parisi
- 464
- 7
- 15
-1
votes
1 answer
How to filter out certain files from the output set of lsof on macOS?
I am using lsof on MacOS to receive a list of files. The execution takes around a minute to finish. I could use grep but that wouldn't improve the execution time of lsof.
Does lsof support a regex/filter option to ignore certain paths? I can only…

HelloWorld
- 2,392
- 3
- 31
- 68
-1
votes
1 answer
RHEL Linux: Discover what processes are using a specific disk
I need to discover what processes are using a specific disk. This is a multipath disk but I cannot find a way of setting up a way to record to a log file what processes are running when a particular disk is being read or written to. I know the…

Yrb6924
- 13
- 3
-1
votes
1 answer
Difference between lsof -c name and lsof | grep ^name?
I'm trying to figure out whether I have a leak in file descriptors using lsof. The -c option to lsof is defined as:
Selects the listing of files for processes executing the command that begins with the characters of c.
If that's true then why do…

marcsetgo
- 33
- 1
- 1
- 5
-1
votes
1 answer
Awk : accommodating the blank cell values
I need to calculate the size of deleted file size per user from lsof command in bash.
But there are few rows which has third column as blank causing issues to sum up values.
For example, in the attached image I need to show the total size by each…

Learner
- 1,544
- 8
- 29
- 55
-1
votes
1 answer
what is lsof showing?
this is the output when i do
lsof -p pid
while my programme is running.
scos-main 60367 root 754u REG 253,0 486 8653830 /apps/const/pkg/pkgout/.its-traceError.log
scos-main 60367 root 758u REG 253,0 486 8653830…
user3591955
-1
votes
2 answers
lsof command doesn't look in specified directory when i specify user
So I was writing a python script and my goal was to use lsof to list all open files under a specific directory (my home folder) for the local user and only output the 'uniq' entries.
My script looked like this:
import os, sys, getpass
user =…

user1634609
- 59
- 1
- 3
-2
votes
2 answers
why I can't start a docker container because the port be allocated?
use lsof to show a port, but every port return same info...
[kfadmin@master fundrisksys]$ lsof -i:136
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash /dev/pts/0
24223 /usr/bin/bash …

Station Yyy
- 1
- 1
-2
votes
1 answer
How to reimplement lsof +D on MacOS two avoid calling stat(2) twice?
I am using lsof to detect which files are opened by which process for a given directory. Example:
% lsof +D /Users/jack/Downloads
Spotify 1431 jack 75r DIR 1,6 128 37333 /Users/jack/Downloads/file1.png
Dock 1439 jack 13r DIR …

HelloWorld
- 2,392
- 3
- 31
- 68