Questions tagged [lsof]

Lsof is a tool to list opened files by processes

Lsof is a tool to list on its standard output file information about files opened by processes.

104 questions
0
votes
1 answer

Check Used Ports on Linux without Command

Is there a way to check Used Ports on Linux without commands, I mean checking files or so on ?
user212051
  • 45
  • 1
  • 9
0
votes
2 answers

How to kill/close log files that are open through lsof grep deleted?

I have a deleted a large log file from our servers. so I executed this command to validate. lsof -nP | grep '(deleted)' and this showed up. how can I permanently delete the results fo this lsof? I need to recliam the needed space on our hardrive
KyelJmD
  • 101
  • 1
  • 3
0
votes
1 answer

How to combine lsof stat and ps to get more info in one line bash command

I can use lsof to get top open files stat for processes, as below: $ lsof -n|awk '{print $2}'|sort|uniq -c|sort -nr | head -n 5 17955 11945 10282 2786 5980 32152 1920 27803 1786 32107 Now I want to expand the result to like below with…
Y.Huang
  • 11
  • 1
0
votes
2 answers

Why big difference between `lsof -p | wc -l` and `lsof | grep | wc -l`

I find an elasticsearch process in Ubntu 14.04 linux vm holding many file handlers, while when I use lsof to do further analysis, it just gives some confusing results as below: $ lsof -p | wc -l $ lsof -p 63589 | wc -l 960 COMMAND PID TID …
Y.Huang
  • 11
  • 1
0
votes
2 answers

View what file started a process in linux

One of my servers started sending spam in heavy amounts. The server is using ISPConfig 3 and one of the web users most likely has a security breach. I have identified the user and one file somehow starts a perl script that sends the spam. However i…
Alex
  • 1
  • 2
0
votes
0 answers

Monitor outgoing web traffic sources on CentOS

I received a report today that a server I manage (Centos + Apache) is launching a bruteforce attack against wordpress websites: hacked-joomla/brobot The requests sent look like this: x.x.x.x - - [15/Nov/2015:19:37:14 +0100] "POST wp-login.php…
0
votes
1 answer

Is there a way to know the duration for which the connection is open using lsof?

If not possible with lsof what other way to find the time for which the connection is open on a machine. Please do let me know if you need any other information.
Biswanath
  • 253
  • 2
  • 7
0
votes
1 answer

find files which are not currently in use

I'm trying to archive some older files, but don't want to touch all the files which are currently in use. What's the best way to ask find to exclude "in use" files? Right now I'm working on this command, but I'm asking if there's something better…
MaxChinni
  • 101
  • 2
0
votes
1 answer

Pipe lsof to grep to awk ps -ef to grep

I'm trying to get some info on a certain PID. I'm probably doing this in a manner that is way too difficult, but I'm trying to run this: lsof | grep grepstuff | awk '{ps -ef | grep $2;}' and I'm not getting anything in response. If I remove the awk…
Sugitime
  • 415
  • 1
  • 4
  • 12
0
votes
1 answer

lsof getting ran by root, but not by a user and using high CPU usage

My server is using high CPU usage from lsof, and it appears to be ran randomly and by the root user. I'm finding this out via Newrelic information Is it at all possible to find what is running this and stopping it? Extra info: Some of the major…
Mattisdada
  • 57
  • 1
  • 2
  • 16
0
votes
1 answer

Open file count keeps increasing forever

I'm experiencing issues with the number of files opened increasing over time. If I run my server for about few hours, it'll no more accept any connections. The limit was 1024. I've increased the limit to about 40,000 and still the number is going up…
AbdullahDiaa
  • 109
  • 2
0
votes
1 answer

Monitoring a cgi-bin executable's file usage?

One of the programs in my cgi-bin folder is misbehaving. It's a compiled binary for which I do not have the source code. I would like to set up some kind of monitor to gather a list of the files that the program opens when it gets executed and dump…
Will Martin
  • 2,431
  • 5
  • 19
  • 18
0
votes
1 answer

KVM how to determine which virtual disk files are in use by VMs

I tried lsof|grep *.qcow2 and got no results back (why is that? I definitely have VMs running using that disk format). I also considered grepping qcow2 on *.xml within the config directory, but this wouldn't tell me which were in use necessarily. Is…
user160910
0
votes
2 answers

What is the meaning of this result from running 'lsof -i:8080'?

When I run the following command: lsof -i:8080 This is the result: node 32419 root 6u IPv4 122865 TCP localhost.localdomain:webcache (LISTEN) That result is different from that of the following command: lsof -i:80 Result: nginx …
augustin
  • 3
  • 1
  • 2
0
votes
2 answers

Clearing out deleted memory mapped files quicker?

We use Tika for PDF text content extraction for searching. I'm seeing heavy use of temporary files that seem to now run us out of file handles. We're on CentOS 5.5. For our search system, we had previously bumped up open file handles…
dbenson
  • 1
  • 1