Questions tagged [lsof]

lsof is a tool to list open files of processes

Filter by
Sorted by
Tagged with
1
vote
1answer
52 views

List files a command opens? lsof is too slow

Is there some utility, that I can run a certain command A "within", that lists all files A opens while executing? I run a utility (A) that changes some password requirements and something is broket. ...
1
vote
0answers
42 views

Why does `lsof` list the open IPv6 network file (socket) when given the `-i4` option, but not when given the `-i6` option?

I have an open IPv6 network file (socket) that I want to inspect using lsof. What bugs me is that lsof reports the socket's type as IPv6, but it only shows it using -i4 option, not the -i6 option: $ ...
-3
votes
2answers
48 views

How can I find files that are not in use by any process and remove them?

I found that ~/.wine/drive_c/users/t/Temp/ has 1.4G bytes of files *.tmp. Some of them are in use by some processes (and I can tell for each file by lsof), and the other are not in use by any ...
6
votes
1answer
65 views

How to detect which process has used a file now or in the past

This is a hypothetical question, not a problem I currently have. How do you detect which process has used a file now or in the past? To find out which process is accessing filename right now, lsof ...
0
votes
1answer
20 views

How to interpret the port mapping strings under name column of lsof results?

I have the following output from lsof -i:portnumber [ztao@MongoDB ~]$ lsof -i:6379 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME redis-ser 5341 ztao 4u IPv6 23457 0t0 TCP *:...
1
vote
1answer
28 views

How to find max limit of /proc/sys/fs/file-max

I am running Jenkins with lots of jobs which require lots of open files so I have increased file-max limit to 3 million. It still hits 3 million sometimes so I am wondering how far I can go. Can I set ...
1
vote
1answer
117 views

Is it possible to force ending of (close wait) connections?

when we run lsof on port 6060 as the following # lsof -i TCP:6060 | more COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME app_lot 3495 root 12u IPv6 9238779 1t0 TCP *:krb0934 (...
0
votes
0answers
27 views

lsof show number of open files that are more then what configured [duplicate]

we verify the file max as [root@linux02 ~]# cat /proc/sys/fs/file-max 500000 but when we run lsof we get [root@linux02 ~]# lsof | wc -l lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/...
0
votes
0answers
38 views

cant counting all open files by lsof + lsof is hung

we are tying to count all open files by lsof lsof | wc -l lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/42/gvfs Output information may be incomplete. but sill after 1 hour ...
0
votes
0answers
20 views

Log connections of any process to a specific host:port

I would like to know which process connects from the local machine to remote host 1.2.3.4 in HTTP. To get this information about actual processes, the command is lsof -i@1.2.3.4:80 However, I ...
1
vote
0answers
38 views

Continuously monitoring network connections

I am looking for a network monitoring tool that can monitor all opened network connections in real-time and its output is easy to parse. What I want to achieve is auditing all in/out network ...
0
votes
2answers
423 views

Is there a python module for lsof?

Each time I try to update my Kali Linux by running sudo apt update I get the following error message Unable to lock directory /var/lib/apt/lists/ The way I fix this problem is by finding ...
1
vote
1answer
88 views

How do I confirm a file sync has completed before executing a command?

I have a computer periodically syncing folders of content with another computer using Resilio Sync. The receiving computer has a sorting process on an hourly cron, which analyses the folders and their ...
5
votes
1answer
56 views

How can I find what a process is trying to watch using strace, lsof, and fdinfo?

I have a process (the NewRelic infra agent) that is hung on a RHEL 7, xfs filesystem host. I'm thinking that it's trying to watch a file or maybe a socket that another process already has in use. ...
1
vote
2answers
397 views

Is lsof part of default RHEL installation?

I am trying to find out if lsof is part of a typical RHEL installation. I see lsof mentioned in a RHEL page titled Common administrative commands in Red Hat Enterprise Linux 5, 6, 7, and 8 but I do ...
0
votes
0answers
45 views

Why can't `lsof` report some open port's information? [duplicate]

I am running this with the IP address of the same machine: $ nmap -p0-65535 192.168.1.198 Starting Nmap 7.60 ( https://nmap.org ) at 2019-03-20 10:13 EDT Nmap scan report for olive.fios-router.home (...
2
votes
1answer
97 views

Red Hat Linux - port is in listening state but could not find process ID

I have this problem for my application, port is in listening state but process ID is not showing up. Used below commands. This is cloud AWS server Red Hat Linux. $ netstat -tulpn tcp 0 ...
0
votes
2answers
611 views

kill deleted files and clean the memory cache

I want to know if kill the delete process , can help to clean the memory cache sometimes we get from lsof many deleted files so does killing them can give more available memory ? example: lsof | ...
0
votes
2answers
234 views

Does lsof always show the resolved absolute pathnames of opened files

In the output of lsof, does the NAME column always output the resolved absolute pathnames of opened files (resolved in the sense of no symlink, . or .. in the pathname)? For example, if I cd into ...
1
vote
2answers
104 views

How can I extract only the pid column and only the pathname column in the lsof output?

$ sudo lsof -u t | grep -i "\.pdf" evince 1788 t 37r REG 8,4 176328 134478 /home/t/some/path1/white space/string1 + string2 string3.pdf evince 3737 t 36r ...
0
votes
0answers
80 views

Why can I not kill a process in the same line I start it using fuser?

I have been trying to kill a process by looking at the listening port and nothing seems to be working. The code is as follows: (code to open port 8545) && fuser -k 8545/tcp I also tried with ...
2
votes
1answer
395 views

lsof versus /proc/$PID/fd versus ulimit -n

I am trying to find the reason why my long-running app sometimes busts the maximum open file descriptor limit (ulimit -n). I would like to periodically log how many file descriptors the app has open ...
0
votes
0answers
305 views

Mount error although no process is using the directory

Trying to mount a remote samba share as follows: sudo mount -t cifs -o user=pkara //11.99.4.32/logstash_config /home/pkara/Workspace/logstash_atlantis/ getting the error mount error(16): Device or ...
0
votes
1answer
108 views

is it possible to avoid open files? [closed]

when we run lsof to capture deleted files , we see the following: ( example ) lsof +L1 java 193699 yarn 1760r REG 8,16 719 0 93696130 /grid/sdb/hadoop/hdfs/data/current/PLP-...
0
votes
0answers
88 views

Service stuck and consuming disk space

What is the best practice to avoid this case Example, filebeat 5098 5128 root 3r REG 253,1 31035908096 657022 /var/log/aaa/aaa.access.log.1 (deleted) There is a ...
2
votes
1answer
332 views

How shall I understand the output of `NAME` field of `lsof`?

$ sudo lsof +E -a -U -p 1480 lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/1000/gvfs Output information may be incomplete. lsof: WARNING: can't stat() fuse.gvfsd-fuse file ...
0
votes
3answers
201 views

Get a certain column of an output with content aligned right and some columns not always filled

This is a problem I often encounter, this time with the output of lsof, but I am searching for a general solution for such problems: selecting a column. Here I try to get the TYPE column of the ...
2
votes
1answer
1k views

lsof shows protocol: TCP

I ran sudo lsof -p $(pidof foo) and I got a lot of these. Does anyone know what these represent? I know they come from the process but there are no ports / IP addresses. COMMAND PID USER FD ...
1
vote
1answer
155 views

lsof doesn't show up my djvu files

I am trying to print the djvu file names that are currently running on either okular or atril, but when I do lsof | grep ".djvu$" then I am getting no output in the terminal, where the same command ...
1
vote
4answers
181 views

command shuts down too quickly for me to lsof it [duplicate]

Might be idiotic, but I'm running a command that completes very fast, so I don't have enough time to lsof it from another window and see which files is it holding open. Is there some obvious way to ...
1
vote
1answer
101 views

What does lsof -ad3-999 -c rsync do?

I was trying to see the progress of a already running rsync and cp task and found this answer that allowed me to see what was currently happening When i went to the man page for lsof and see that -c ...
0
votes
1answer
78 views

How to list all the processes which have accessed a particular file? [duplicate]

strace can monitor only one single processes not all, lsof is not a good way too, it's not a real time tool, maybe I need a real time version of lsof? How to list all the processes which have accessed ...
0
votes
1answer
449 views

Is it possible to list all files that are opened by a process [duplicate]

I know that lsof can list all files which are being opened by running processes. If there is a process, which will open a file and then will be terminated, I don't think I can catch the file that is ...
1
vote
1answer
168 views

What does “localhost:tram” message means?

I have deployed an application in Glassfish. I see "localhost:tram" in the list of open files : java 30842 user 1589u IPv6 555599352 0t0 TCP localhost:57171->localhost:tram (CLOSE_WAIT) java 30842 ...
2
votes
0answers
328 views

netstat show a listen port but pid don't exist and can't find it with lsof

I am running macOS(0.13.6) and while trying to test tinc, I get a warning that port 0.0.0.0:655 is already in use. This is the output I get from netstat: $ sudo netstat -anv -p udp Active Internet ...
2
votes
1answer
70 views

How to link a tunX interface to a specific OpenVPN instance?

I known that I can give a specific name to the TUN interface using --dev option, but I didn't and I have now on a router machine something like a hundred client configs. with less clients I was able ...
3
votes
1answer
414 views

Find processes which have a file open without lsof or fuser

I'm working on a Linux (Scientific Linux CERN SLC release 6.9 (Carbon)) machine on which I am unable to install programs and on which the lsof or fuser commands are not available. I'm trying to ...
0
votes
0answers
427 views

disk in use in-spite we perform umount and lsof is empty

we want to perform fsck -f on /dev/sdc but without success umount -l /var/hadoop/zookeper lsof /var/hadoop/zookeeper/ fsck -f /dev/sdc fsck from util-linux 2.23.2 e2fsck 1.42.9 ...
2
votes
1answer
443 views

What is the difference between lsof vs lsof -i

One of my processes running on Debian server started throwing a socket: too many open files error. I then started debugging the error. I came through the following scenario. When I ran lsof | grep ...
1
vote
2answers
469 views

Linux memory mapped files

Output of lsof on my RHEL7 shows that one file with file descriptor mem is used by 40 processes. Does it mean that this file is mapped in memory 40 times or what? Could someone please explain what ...
0
votes
1answer
322 views

What does the asterisk (*) mean in lsof output?

I set my TCP server to localhost 127.0.0.1, but instead of seeing 127.0.0.1 in the host portion of the lsof output, I see an asterisk. After running lsof -i... my_process 66666 root 5u IPv4 0xffff......
1
vote
2answers
218 views

Trying to pass some output of lsof -Pi to geoiplookup

Looking for a way to pass the second column of output to geoiplookup, ideally on the same line, but not necessarily. This is the best I can muster. It's usable, but the geoiplookup results are ...
1
vote
0answers
55 views

Can't find the reason why root directory usage is so large [duplicate]

Everyone. I have a very difficult thing to do. I have a Linux server, and the root directory has 16GB of space. df -h, shows the / directory has been used for 15GB, but du -sh shows that only 5.9GB ...
1
vote
1answer
8k views

“Device or Resource Busy”

I am trying to delete a directory using rm -rf dirName But I receive a bunch of errors like: rm: cannot remove 'deleteMe/icarus/.nfs0000001bcf11514a0000cd45': Device or resource busy When I try ...
3
votes
1answer
1k views

FD column of `lsof` shows DEL in some cases, instead of an FD number

What does this mean? How does lsof find such FDs? I.e. compared to normal FDs, which can be found easily like ls -l /proc/$PID/fd/$FD. $ lsof -p $(pgrep pulseaudio) | head -n1 COMMAND PID ...
1
vote
1answer
85 views

Open connections with unresolvable domain

Output of sudo watch lsof -i and sudo watch netstat -tp show ESTABLISHED connections with unresolvable domain (e.g., host, dig woldn't resolve, trying to access domain directly via URL from firefox ...
2
votes
3answers
2k views

How to use lsof to list all files open by the parent process AND its children?

lsof -p PID works fine to list all files open by a single process, but I need to list all currently open files by a specific master process AND its children processes. What is the best way to do this?...
2
votes
0answers
597 views

File shows up in ls but cannot rm or mv, seems to be held by some unknown process

I do a lot of work on an SGE cluster running CentOS 7, and have recently had issues with jobs dying randomly, but seemingly with some processes still running that prevent me from cleaning up to start ...
2
votes
2answers
242 views

find pid of open tcp port, as a regular user

From local host I'm ssh tunneling some remote host:port to my local host:port, so anybody on a remote host can use their "local" port to access my port via that tunnel. I'm using some regular (non-...
1
vote
2answers
1k views

How to test if processes are using files in directory

I'm trying to use lsof in an IF statement to tar a directory ONLY if other programs are NOT using files within the directory. I can get this info at a shell prompt with lsof +d /mydir/ If it doesn'...