Skip to main content
Filter by
Sorted by
Tagged with
-1 votes
1 answer
87 views

How to determine what is using a port

When our tests run in CI, we occasionally see failures caused by java.net.BindException: Address already in use. In order to investigate this, we would like to be able to execute some code to tell us ...
cpp beginner's user avatar
-1 votes
1 answer
271 views

Difference between lsof -i :<port> & socket statistics ss -lp | grep <port>?

I'm using AWS linux / RHEL and I am trying to identify & remove zombie PIDs that are hogging ports to ensure clean start/stopping of application services. man lsof -i : will give me the "...
Marc Leprince's user avatar
0 votes
1 answer
76 views

verify open file descriptor with lsof

I think that my program leaves one open file descriptor. int main() { int my_fd = dup(STDOUT_FILENO); char *cmd[2]; cmd[0] = "/bin/ls"; cmd[1] = NULL; dprintf(2, "...
a k's user avatar
  • 21
0 votes
0 answers
50 views

What is parent directory of a process?

In lsof output, it mentions 3 types of directories, cwd, rtd and pd. I understand cwd and rtd. But what is pd aka., parent directory for a process? I tried lsof | grep ' pd ', but I got no output. So ...
Sourav Kannantha B's user avatar
-1 votes
1 answer
147 views

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.') } ...
Aaron Parisi's user avatar
0 votes
0 answers
307 views

How to decrease many opened files by MySQL in "lsof" command?

There are large number of MySQL tables, it's more than thousands tables. A few tables is accessed in short time, a large number of tables is accessed in long time. And it's shown many files opened a ...
quenty658's user avatar
  • 1,607
-1 votes
2 answers
158 views

why I can't start a docker container ? it reports something about the port being allocated [closed]

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/...
Station Yyy's user avatar
0 votes
2 answers
216 views

Find who is holding cryptsetup/LUKS encrypted home (some KDE/X vs common sense madness)

I'm fighting some ridiculous no-so-eeasy to debug case with my cryptsetup/LUKS encrypted home directory. The setup: I have partition that is dedicated to my user home directory and encrypted with ...
e-pirate's user avatar
  • 183
-1 votes
1 answer
326 views

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/...
HelloWorld's user avatar
  • 2,263
-2 votes
1 answer
106 views

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/...
HelloWorld's user avatar
  • 2,263
0 votes
1 answer
115 views

Two processes listen on the same port (using Jersey), but not responding to same requests

I have two very simple apps listening on TCP HTTP 4466. Both use Jersey 2.X but one is a native-image and the other is a java UncompiledMain.java process (I'm trying to migrate to java native images ...
Sridhar Sarnobat's user avatar
9 votes
3 answers
59k views

Automatically solve rm cannot remove path : device or resource busy error

I am trying to remove a directory /path/to/dir using the rm -rf command. Unfortunately I get the error rm: cannot remove '/path/to/dir/.nfsdda293a660f276ca0000000a': Device or resource busy After a ...
JejeBelfort's user avatar
  • 1,633
1 vote
0 answers
314 views

Trying to figure out why empty files like /tmp/fc007620c1c8dcca are being created

Example of the empty files created in /tmp: -rw------- 1 root wheel 0B Mar 27 00:57 fc007620c1c8dcca -rw------- 1 root wheel 0B Mar 27 01:00 fc007620c1c95a20 -rw------- 1 root wheel ...
Linda Derezinski's user avatar
1 vote
0 answers
127 views

Is there a situation where curl can access a port that lsof doesn't to?

What could have led to this? [doge]
user2685761's user avatar
1 vote
1 answer
3k views

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 ...
Drew's user avatar
  • 13.2k
2 votes
3 answers
3k views

Could I list all running docker-compose files?

I was wondering if it would be possible to list all running docker-compose files with a bash function? Something like docker ps or docker container ls, but I want it to show the files only. I got ...
kvelev's user avatar
  • 63
0 votes
1 answer
714 views

lsof -i output explanation [closed]

Google said lsof -i [i] selects the listing of files any of whose Internet address matches the address specified in i. If no address is specified, this option selects ...
Alex's user avatar
  • 732
0 votes
1 answer
299 views

How to print out the access right from linux kernel module

When I run the command lsof from a terminal, it will show a detail list of all file descriptor with a header is FD. And FD column numbers like 1u is actual file descriptor and followed by u,r,w of it’...
Anh Hoang's user avatar
  • 127
0 votes
1 answer
696 views

Use of watch and lsof + grep together [duplicate]

When i use lsof -p 3536693 | grep snapshot I get an output but if i try to watch lsof -p 3536693 | grep snapshot I get nothing. Aren't they compatible? It works if I ommit grep, like watch lsof -p ...
CrazyRabbit's user avatar
2 votes
2 answers
424 views

A flask website, when it delete a file (os.remove("abc.txt")), the file is removed but the space is not reclaimed

The program is a standard flask program, and it does some cleanup as part of the initialization. In the cleanup() procedure, using os.remove("abc.txt"), I noticed that the file is removed, ...
Ben L's user avatar
  • 347
0 votes
2 answers
190 views

How to use lsof inside of Makefile

Suppose I have something like .PHONY: kill-server kill-server: kill -9 $(lsof -t -i :9000) Why it doesn't work and how do I fix this?
Adil Akhmetov's user avatar
1 vote
0 answers
301 views

lsof showing duplicates entry of files opened by elasticsearch

on lsof I can see there are multiple entries of the same files opened by elastic search. The files are in format of elasticdb/data/nodes/0/indices/AW0VfnbAQB-7Z43UAXCUdw/0/index/_1.cfs The interesting ...
Arun Pal's user avatar
  • 747
0 votes
1 answer
868 views

Linux: how to know which process (or program) is sending data to a local port?

I launched a program that listens at 127.0.0.1:3000 on a CentOS server. I haven't sent any message to the program but it keeps receiving data. I want to know who is sending data to my program. So I ...
Richard Hu's user avatar
2 votes
2 answers
2k views

How to identify if file is still written or completed through linux script

We have one system which is generating files and I want to check which files out of many files are completed and also not been modified from past two minutes through a script and finally rename those. ...
Rohit Shamdasani's user avatar
3 votes
0 answers
240 views

java Kafka send messages in docker is increasing open files (lsof ) at almost 50/sec

My java web application is running in docker container. Java application is sending messages to Kafka (~ 300 msgs/hour). The server is crashing very few hours. I need tot restart the server every few ...
firemonkey's user avatar
0 votes
0 answers
2k views

lsof command output not piping to grep properly [duplicate]

I'm in a Ubuntu 18.04 environment, and I'm trying to grep the output of lsof to get some detailed info about files being locked on my system. My command is simple, and goes like so: sudo lsof | grep '...
tuskiomi's user avatar
  • 191
0 votes
1 answer
969 views

Timeout in Shell Script

Using Shell Script like below: if [[timeout 60 | wsof -l]]; then echo "thread sleeping for 60 seconds" exit else echo "timeout failed" exit fi But getting error timeout failed. How ...
user avatar
1 vote
1 answer
968 views

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 ...
Heiko Gruner's user avatar
0 votes
1 answer
949 views

Postgres database port 5432. Is it connecting to the internet?

I am a newbie to connections. I ran the following command on my ubuntu server: lsof -nP -iTCP -sTCP:LISTEN and this came up, among other connections: postgres 29826 postgres 7u IPv6 192275 ...
user avatar
1 vote
0 answers
222 views

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 ...
BTH.S3's user avatar
  • 329
-1 votes
1 answer
275 views

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 ...
Yrb6924's user avatar
  • 13
0 votes
1 answer
190 views

Use of lsof Command

When I open a file in a Python Program sptxt = open('output.txt','w') And then run following: i@raspberrypi:~/Watson $ lsof /home/pi/Watson/output.txt COMMAND PID USER FD TYPE DEVICE SIZE/OFF ...
Hankp's user avatar
  • 55
0 votes
1 answer
928 views

How to kill all processes which have '/var/' string in the description?

I am using lsof to find out all processes which have /var/ in the description. [root@localhost ~]# lsof | grep /var/ | less systemd 1 root 105u unix ...
meallhour's user avatar
  • 15.3k
0 votes
0 answers
416 views

HDFS + lsof + how to find the files that are currently being used for each HDFS folder

We are trying to find the currently being used of opened files on each folder in HDFS. So we try the following hadoop fs -lsof /user/hdfs/.sparkStaging/application_1586272450810_3249 But this doesn’t ...
jessica's user avatar
  • 2,560
0 votes
1 answer
1k views

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 ...
marcsetgo's user avatar
8 votes
0 answers
534 views

Excessive File Handles (on lsof) When Python logging with Starlette and Uvicorn

I have a minimal starlette app running via uvicorn doing nothing but returning a ping. Strangely, even with a single thread, I have 45 file handles to my log file. The handles increase with hits to ...
CoderOfTheNight's user avatar
0 votes
1 answer
677 views

Meaning of localhost:dsf

I am working on a Python Server application that runs on 127.0.0.1 : 555 and I am trying to show the port 555 on lsof, or netstat. My system is macOS and when I type sudo lsof | grep localhost on ...
efedoganay's user avatar
1 vote
2 answers
1k views

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 ...
Tirafesi's user avatar
  • 1,407
0 votes
1 answer
448 views

How to list open files in read-write and write-only on a BTRFS filesystem?

I'm writing a bash backup script, which creates BTRFS subvolume snapshots on a mounted volume (i.e. /mnt/btrfs/subvolume). As usual I would use "lsof /mnt/btrfs/subvolume" and pipe its output to ...
tio78's user avatar
  • 11
0 votes
1 answer
162 views

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 ...
Learner's user avatar
  • 1,624
0 votes
0 answers
30 views

Any negative consequences when allowing Linux app more file handles?

In Linux, one can configure soft and hard limits of file handles per user, app or system globally. I understand that this is a security feature to prevent one app consuming too many resources. But: ...
Sebi's user avatar
  • 8,763
1 vote
1 answer
328 views

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'...
user3732445's user avatar
4 votes
0 answers
83 views

Xamarin iOS app uses 750 file handles on iOS 12 simulator, only 250 on iOS 13 simulator

I have a Xamarin iOS app that runs on both the iOS 12 simulator and iOS 13 simulator. I am using Visual Studio Professional to launch a simulator on a paired Mac. The Mac has iOS 12.0 simulators and ...
Richthofen's user avatar
  • 2,086
1 vote
1 answer
283 views

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 ...
Mayor of the Plattenbaus's user avatar
0 votes
1 answer
390 views

How is it possible to identify a website using the process id and port?

I am trying to link a website to a particular opened port. However, using both netstat and lsof, I found that when I open a single website on firefox (say facebook), there are multiple process and ...
bislinux's user avatar
  • 313
1 vote
0 answers
594 views

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 ...
gibbone's user avatar
  • 2,600
0 votes
2 answers
2k views

lsof shell command in php denied

i have the following code: $cmd="lsof | awk '{print $1 \" \" $2 \" \" $3 \" \" $9}'"; $info = shell_exec($cmd); $processors = preg_split('/\s?\n\s?\n/', trim($info)); ...
somejkuser's user avatar
  • 9,008
0 votes
1 answer
232 views

understanding TYPE in lsof output

I opened a file through python. So, i did a lsof on the python process. output of lsof has the following line COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME python 15855 inaflash ...
rawwar's user avatar
  • 4,952
1 vote
2 answers
1k views

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 ...
hckrman's user avatar
  • 136
1 vote
0 answers
169 views

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 ...
ermSO's user avatar
  • 335

1
2 3 4 5