lsof is a tool to list open files of processes

learn more… | top users | synonyms

1
vote
2answers
43 views

How to determine the newly closed file within a continuous audit log rotation?

I am attempting to find the best way to determine when the second file (of a matching criteria) is created. The context is an audit log rotation. Given a directory where audit logs are created every ...
21
votes
2answers
4k views

Who's got the other end of this unix socketpair?

I want to determine what process has the other end of a unix socket, that was created with socketpair(). I have a program parent which creates a socketpair(AF_UNIX, SOCK_STREAM, 0, fds), and fork()s. ...
2
votes
0answers
59 views

ls does not show a hidden file (OS X)

I am using lsof to view the list of open files. One such file that it displays open is : Google 3864 malaykeshav 46u REG 1,1 470455334 32578671 ...
6
votes
2answers
69 views

FreeBSD 10 trace disk activity

Is there any way to find some process which is periodically writing to disk (according to hdd led) on FreeBSD 10 with ZFS (maybe turn ZFS into verbose logging mode)? lsof and other instantly ...
5
votes
3answers
697 views

How can I know the process name which is opening a tcp port?

I have two linux servers. Let's say they are C and S. C is client of S On my S machine, I type. $ netstat -an | grep ESTABLISHED tcp 0 0 192.168.1.220:3306 C:57010 ...
1
vote
1answer
31 views

Limiting readers on a pipe

I want to use a pipe to pass some security credential information from "process1" to another script. I only want authorized reader processes to be permitted to read the pipe. I am thinking I will ...
0
votes
1answer
172 views

how to get the stream URL of flash radio

I am listening to a radio stream (flash content in a browser). I want to play this stream directly with mplayer or the like. Doing lsof -ni shows me these two lines (among others): plugin-co 13248 ...
1
vote
1answer
19 views

run lsof in non-interactive mode

I need to write lsof output for several network ports into bash variable. Simple $(lsof -i :5555) doesn't work - lsof waits for quit command (Ctrl-C) every time I call it. I can't figure out how to ...
2
votes
1answer
28 views

Forcing compton to free directory

I often have trouble unnounting filesystems because compton is keeping a subdirectory open. Here is one line from lsof I have right now: compton 30043 valmi cwd DIR ...
3
votes
1answer
32 views

link count of deleted files

I am reading in man lsof that +L enables the listing of file link counts. A specification of the form "+L1" will select open files that have been unlinked. I don't understand why deleted files ...
0
votes
2answers
85 views

what process is listening on a given port

I have several problems: some process is attempting to send data and the firewall is rejecting it at the rate it is sending it out firewall logs flood the system (may need to rate-limit the logging) ...
2
votes
1answer
144 views

Memcache 'stats' reports non-zero 'curr_connections' - but lsof shows no socket connections

Our memcache daemon reports non-zero 'curr_connections'... $ telnet memcache-server 11211 Escape character is '^]'. stats ... STAT curr_connections 12 ... ...and yet, lsof shows no socket ...
0
votes
1answer
66 views

understanding lsof -i output with web browsing

Sorry, if my question is nooby, but i don't understand some output lsof command. I try to run lsof -i on my home machine(debian linux) and what i obtain (showed one line; my browser chromium was ...
2
votes
2answers
500 views

lsof: show files open as read-write

When I try to remount a partition as read-only, I get an error /foo is busy. I can list all files open from /foo with lsof /foo but that does not show me whether files are open read-only or ...
3
votes
1answer
275 views

How can I figure out which pty's are from which qemu?

I'm running qemu's like this: $ sudo qemu -boot d -m 1024 \ -netdev tap,id=tap0 \ -device virtio-net-pci,netdev=tap0,id=vth0 \ -drive file=ubuntu.iso,media=cdrom,cache=none,if=ide \ -monitor pty \ ...
0
votes
1answer
414 views

root permission denied on /proc/1/exe

I just performed a fresh ubuntu install and i am seeing the following in lsof: userA@az1:~$ lsof COMMAND PID TID USER FD TYPE DEVICE SIZE/OFF NODE NAME init 1 ...
4
votes
1answer
218 views

How do I update lsof port on FreeBSD 9.2?

It threw errors about kernel sources missing. So, I looked and sure enough this box doesn't have them. The documentation I have says to install them via sysinstall. That failed both automatically ...
2
votes
2answers
203 views

lsof - debug the output information

I was going through the questions of this site. In this particular question, I see the command lsof being used to list the files that are open for a particular user. I ran the below command in my ...
5
votes
2answers
650 views

fuser vs lsof to check files in use

I've been getting some suggestions on how to figure out why my serial port is busy. Specifically, when I try to start gammu-smsd, it refuses to start on /dev/ttyS0 because it says that port is busy: ...
17
votes
5answers
27k views

Determining what process is bound to a port

I know that using the command: lsof -i TCP (or some variant of parameters with lsof) I can determine which process is bound to a particular port. This is useful say if I'm trying to start ...
0
votes
1answer
435 views

When looking at lsof output, what does “0t0” mean?

When looking at lsof output, what does "0t0" mean?
0
votes
1answer
73 views

How to increase the link count for a directory, link count went to 0?

I have made myself land in this situation, it is a chrooted workspace on my system where I virtualize the entire file system ( so its not actual /var/log ) Is there a way that I can either delete this ...
7
votes
3answers
26k views

Alternatives for “lsof” command?

In many cases "lsof" is not installed on the machines that with I have to work, but the "function" of lsof would be needed very much (ex. on AIX). :\ Are there any "lsof" like applications in the ...
1
vote
2answers
78 views

Tracking which files are used by program

I am looking for a way to track which files are used by program installer(InstallAnywhere). I cannot use lsof because as far as I know it works on active processes and I want a tool which will work ...
10
votes
5answers
5k views

Under AIX, how can I get the full path of a program bound to a port?

Under Linux I can use netstat -tulpnw and ps, like so: # netstat -tulpnw | grep :53 tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1482/named udp ...
0
votes
2answers
2k views

“lsof: can't read namelist from /dev/ksyms” on Solaris

On Solaris, when I type the command lsof -l I encountered this error: lsof: can't read namelist from /dev/ksyms Anyone knows what this error means and how I can get open the list of open FD's ...
3
votes
1answer
114 views

lsof doesn't return files open by the same user

Consider this simple scenario: I open a text file ~/textfile.txt with vim in one terminal (tried with both edit and read-only modes). In a different terminal, I run /usr/sbin/lsof ~/textfile.txt ...
4
votes
3answers
272 views

How to tell if a file is being downloaded by wget?

I use wget to download files (most are zip files) automatically for me during the night. However, sometimes in the morning I find that a few files cannot be unzipped. I don't know why this is ...
3
votes
1answer
437 views

What do GDIR, GREG, VDIR, VREG mean in lsof output

The lsof manpage says the following about the TYPE column. TYPE is the type of the node associated with the file - e.g., GDIR, GREG, VDIR, VREG, etc. Can someone please explain (or point ...
0
votes
3answers
3k views

How to interpret this output of lsof command?

root@host [/home2]# lsof /home2 COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME php 3182 ctxmortg cwd DIR 8,17 4096 32858196 /home2/ctxmortg/public_html/hello php ...
2
votes
1answer
760 views

What's the difference between lsof and fuser -uvm

Both shows the number of files we're using. Yet they both shows different results. root@host [~]# lsof /home4 root@host [~]# lsof /home2 root@host [~]# lsof /home4 Then we got fuser -uvm /home4 ...
1
vote
1answer
227 views

iostat report huge writes to drives that's not even mounted

root@host [~]# fsck /home2 fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/sdb1: clean, 6018617/91578368 files, 54524459/366284000 blocks root@host [~]# fsck /home4 fsck from ...
11
votes
1answer
2k views

How do I monitor opened files of a process in realtime?

I know I can view the open files of a process using lsof at that moment in time on my Linux machine. However, a process can open, alter and close a file so quickly that I won't be able to see it when ...
0
votes
1answer
1k views

lsof compares to pfiles, difference?

pfiles in Solaris suspends files for a short period while examining them, however, lsof does not. How does lsof work that allows it to retrieve information while not suspending files?
4
votes
3answers
2k views

How do I get a mapping of Pid to Port?

I have a process which I need to run on a specific port. I have started some other process on that port and I need to kill it. Unfortunately, I don't remember the name/pid of the other process so I ...
6
votes
3answers
1k views

Faster alternatives to lsof

I want to extract the process id of a certain process in order to shut it down. The process is a local web server using a certain port (localhost:3000), and I am currently doing it like this to ...
1
vote
0answers
181 views

Information about the 1630/master app

When I run $ sudo netstat -a --programs | grep LISTENING | grep 1630 I will get this output. Do you know what good are processes running under this app name? Why they I running on my system and if ...
1
vote
1answer
197 views

How can I monitor if anybody (any process) access is certain file [duplicate]

Possible Duplicate: Access history of a file I know if a file is "being accessed" I can use lsof to see who (which process) is accessing it, but lsof is slow and heavy and I don't think I ...
8
votes
2answers
693 views

lsof - age of file

The *nix command lsof gives you a list of open files. Is anyone aware of a way that would also list how long a particular file has been open? Either by using lsof or any other command. I'm using ...
7
votes
1answer
6k views

lsof and listening ports

I am trying to get all the processes listening for a network connection on Mac OS X. netstat does not have the -p option and I am trying with lsof lsof -i -sTCP:LISTEN gives me a fair list of ...