lsof¶
Show 10 Largest Open Files¶
Kill a process running on port 8080¶
Kill a process running on port 8080¶
Kill a process running on port 8080¶
dynamically list open files for a given process name¶
lsof -i -n -P | grep -e "$(ps aux | grep node | grep -v grep | awk -F' ' '{print $2}' | xargs | awk -F' ' '{str = $1; for(i = 2; i < NF; i++) {str = str "\\|" $i} print str}')"
Two command output¶
This will kill all ssh connections from a given host it does give some errors but it does work¶
For finding out if something is listening on a port and if so what the daemon is.¶
Keep a copy of the raw Youtube FLV,MP4,etc stored in /tmp/¶
lsof -n -P|grep FlashXX|awk '{ print "/proc/" $2 "/fd/" substr($4, 1, length($4)-1) }'| \
while read f;do
newname=$(exiftool -FileModifyDate -FileType -t -d %Y%m%d%H%M%S $f|cut -f2|tr '\n' '.'|sed 's/\.$//');echo "$f -> $newname";cp $f ~/Vids/$newname;
done
The program listening on port 8080 through IPv6¶
pid list by httpd listen port¶
View open file descriptors for a process.¶
check open ports (both ipv4 and ipv6)¶
開いてるポートを調べる¶
check open ports (both ipv4 and ipv6)¶
Show the processes that use old libs and need a restart¶
which program is this port belongs to ?¶
which process has a port open¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment.¶
List open IPv4 connections¶
List files opened by a PID¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List .log files open by a pid¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Lists all listening ports together with the PID of the associated process¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
View details of network activity, malicious or otherwise within a port range.¶
list processes with established tcp connections (without netstat)¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
determine if tcp port is open¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List all files opened by a particular command¶
Find size in kilobyte of files that are deleted but still in use and therefore consumes diskspace¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List processes playing sound¶
Show top running processes by the number of open filehandles they have¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Show established network connections¶
Show apps that use internet connection at the moment. (Multi-Language)¶
show all established tcp connections on os x¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
check open ports (both ipv4 and ipv6)¶
Monitoring file handles used by a particular process¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
kill all processes using a directory/file/etc¶
which process is accessing the CDROM¶
Show what a given user has open using lsof¶
List pr. command in megabytes sum of deleted files that are still in use and therefore consumes diskspace¶
lsof -ns | grep REG | grep deleted | awk '{a[$1]+=$7;}END{for(i in a){printf("%s %.2f MB\n", i, a[i]/1048576);}}'
List all open ports and their owning executables¶
check open ports¶
find listening ports by pid¶
List all active access_logs for currently running Apache or Lighttpd process¶
lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'
give me back my sound card¶
The program listening on port 8080 through IPv6¶
Keep track of diff progress¶
find out which directories in /home have the most files currently open¶
lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgr
find established tcp connections without using netstat!!¶
List open TCP/UDP ports¶
Which processes are listening on a specific port (e.g. port 80)¶
List open files that have no links to them on the filesystem¶
show the working directories of running processes¶
List all the files that have been deleted while they were still open.¶
List the files any process is using¶
View internet connection activity in a browser¶
View network activity of any application or user in realtime¶
Open Port Check¶
Top 15 processes with the largest number of open files¶
Show what PID is listening on port 80 on Linux¶
find all open files by named process¶
Find out which process uses an old lib and needs a restart after a system update¶
Discovering all open files/dirs underneath a directory¶
find the delete file ,which is in use¶
List programs with open ports and connections¶
truncate deleted files from lsof¶
View internet connection activity in a browser¶
Show a listing of open mailbox files (or whatever you want to modify it to show)¶
check to see what is running on a specific port number¶
List open file descriptor count by PID¶
identify active network connections¶
lsof - cleaned up for just open listening ports, the process, and the owner of the process¶
Grabs Open Files and Then Greps Them¶
Display any udp/tcp connections by process name or by process id¶
find the process that is using a certain port e.g. port 3000¶
Show all listening and established ports TCP and UDP together with the PID of the associated process¶
Display IP addresses Pidgin IM Client is connected to¶
lsof -p `pidof pidgin` | awk '{ print $9 }'|egrep `hostname` | grep -o ">[^:]\+:" | tr -d ":>" | while read line; do host $line; done;
Print all open regular files sorted by the number of file handles open to each.¶
Check which files are opened by Firefox then sort by largest size.¶
lsof -p $(pidof firefox) | awk '/.mozilla/ { s = int($7/(2^20)); if(s>0) print (s)" MB "$9 | "sort -rn" }'
what?s running on a given port on your machine?¶
Show which process is blocking umount (Device or resource is busy)¶
truncate deleted files from lsof¶
lsof | grep -i deleted | grep REG | grep -v txt | ruby -r 'pp' -e 'STDIN.each do |v| a = v.split(/ +/); puts `:> /proc/#{a[1]}/fd/#{a[3].chop}`; end'
Keep a copy of the raw Youtube FLV,MP4,etc stored in /tmp/¶
lsof -n -P|grep FlashXX|awk '{ print "/proc/" $2 "/fd/" substr($4, 1, length($4)-1) }'|while read f;do newname=$(exiftool -FileModifyDate -FileType -t -d %Y%m%d%H%M%S $f|cut -f2|tr '\n' '.'|sed 's/\.$//');echo "$f -> $newname";cp $f ~/Vids/$newname;done
which program is this port belongs to ?¶
which process has a port open¶
Watch Network Service Activity in Real-time¶
Watch Network Service Activity in Real-time¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment.¶
List open IPv4 connections¶
List files opened by a PID¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List .log files open by a pid¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Lists all listening ports together with the PID of the associated process¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
View details of network activity, malicious or otherwise within a port range.¶
list processes with established tcp connections (without netstat)¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
determine if tcp port is open¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List all files opened by a particular command¶
Find size in kilobyte of files that are deleted but still in use and therefore consumes diskspace¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
List processes playing sound¶
Show top running processes by the number of open filehandles they have¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
Show established network connections¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
show all established tcp connections on os x¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
check open ports (both ipv4 and ipv6)¶
Monitoring file handles used by a particular process¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
kill all processes using a directory/file/etc¶
Watch Network Service Activity in Real-time¶
Show apps that use internet connection at the moment. (Multi-Language)¶
which process is accessing the CDROM¶
Show what a given user has open using lsof¶
List pr. command in megabytes sum of deleted files that are still in use and therefore consumes diskspace¶
lsof -ns | grep REG | grep deleted | awk '{a[$1]+=$7;}END{for(i in a){printf("%s %.2f MB\n", i, a[i]/1048576);}}'
List all open ports and their owning executables¶
check open ports¶
find listening ports by pid¶
List all active access_logs for currently running Apache or Lighttpd process¶
lsof -p $(netstat -ltpn|awk '$4 ~ /:80$/ {print substr($7,1,index($7,"/")-1)}')| awk '$9 ~ /access.log$/ {print $9| "sort -u"}'
give me back my sound card¶
The program listening on port 8080 through IPv6¶
Keep track of diff progress¶
find out which directories in /home have the most files currently open¶
lsof |awk ' {if ( $0 ~ /home/) print substr($0, index($0,"/home") ) }'|cut -d / -f 1-4|sort|uniq -c|sort -bgr
find established tcp connections without using netstat!!¶
List open TCP/UDP ports¶
Which processes are listening on a specific port (e.g. port 80)¶
List open files that have no links to them on the filesystem¶
show the working directories of running processes¶
List all the files that have been deleted while they were still open.¶
List the files any process is using¶
View internet connection activity in a browser¶
View network activity of any application or user in realtime¶
Open Port Check¶
Top 15 processes with the largest number of open files¶
Show what PID is listening on port 80 on Linux¶
find all open files by named process¶
Find out which process uses an old lib and needs a restart after a system update¶
Discovering all open files/dirs underneath a directory¶
find the delete file ,which is in use¶
List programs with open ports and connections¶
truncate deleted files from lsof¶
View internet connection activity in a browser¶
Show a listing of open mailbox files (or whatever you want to modify it to show)¶
check to see what is running on a specific port number¶
List open file descriptor count by PID¶
identify active network connections¶
sof - cleaned up for just open listening ports, the process, and the owner of the process¶
Grabs Open Files and Then Greps Them¶
Display any udp/tcp connections by process name or by process id¶
find the process that is using a certain port e.g. port 3000¶
Show all listening and established ports TCP and UDP together with the PID of the associated process¶
Display IP addresses Pidgin IM Client is connected to¶
lsof -p `pidof pidgin` | awk '{ print $9 }'|egrep `hostname` | grep -o ">[^:]\+:" | tr -d ":>" | while read line; do host $line; done;
Print all open regular files sorted by the number of file handles open to each.¶
Check which files are opened by Firefox then sort by largest size.¶
lsof -p $(pidof firefox) | awk '/.mozilla/ { s = int($7/(2^20)); if(s>0) print (s)" MB "$9 | "sort -rn" }'
what?s running on a given port on your machine?¶
Show which process is blocking umount (Device or resource is busy)¶
Last update: August 10, 2022
Created: August 10, 2022
Created: August 10, 2022