Home -- Contact -- Site Map

Friday, January 22, 2010

List apps. using an internet connection


Show apps that use internet connection at the moment


typing in lsof without any arguments is a terrible mess, however using some of the arguments in the link makes some pretty output

Go ahead and look at the manuals for lsof, ss, and netstat, then close them....They're all really long....Reading is for chumps.


System details:
Ubuntu 9.10

aggitan@Moneque:~$ uname -a
Linux Moneque 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31 UTC 2009 i686 GNU/Linux


lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2

aggitan@Moneque:~$ lsof -P -i -n | cut -f 1 -d " "| uniq | tail -n +2
software-
pidgin
skype
evolution
firefox
skype


ss -p | cut -f2 -sd\"

aggitan@Moneque:~$ ss -p | cut -f2 -sd\"
firefox
software-center
skype
evolution-data-
pidgin
firefox
pidgin
pidgin
pidgin
skype
pidgin


ss -p | cat

aggitan@Moneque:~$ ss -p | cat
State Recv-Q Send-Q Local Address:Port Peer Address:Port
ESTAB 0 0 192.168.1.2:58623 74.125.127.191:www users:(("firefox",5652,59))
CLOSE-WAIT 1 0 192.168.1.2:49530 91.189.89.31:www users:(("software-center",3165,42))
ESTAB 0 0 192.168.1.2:37498 97.74.195.163:23314 users:(("skype",5993,28))
ESTAB 0 0 192.168.1.2:38578 74.125.19.104:https users:(("evolution-data-",3522,23))
ESTAB 0 0 192.168.1.2:52701 64.12.104.29:aol users:(("pidgin",3220,7))
ESTAB 0 0 192.168.1.2:58629 74.125.127.191:www users:(("firefox",5652,66))
ESTAB 0 0 192.168.1.2:50324 64.4.34.34:msnp users:(("pidgin",3220,24))
ESTAB 0 0 192.168.1.2:41756 64.12.200.200:aol users:(("pidgin",3220,26))
ESTAB 0 0 192.168.1.2:46001 205.188.248.153:aol users:(("pidgin",3220,27))
LAST-ACK 0 1 192.168.1.2:50468 64.211.162.170:www
ESTAB 0 0 192.168.1.2:56745 97.102.113.65:39196 users:(("skype",3275,25))
ESTAB 0 0 192.168.1.2:48318 68.180.217.22:mmcc users:(("pidgin",3220,22))
ESTAB 0 0 192.168.1.2:45615 208.82.32.2:https


ss -p | grep STA

aggitan@Moneque:~$ ss -p | grep STA
ESTAB 0 0 192.168.1.2:58623 74.125.127.191:www users:(("firefox",5652,59))
ESTAB 0 0 192.168.1.2:37498 97.74.195.163:23314 users:(("skype",5993,28))
ESTAB 0 0 192.168.1.2:38578 74.125.19.104:https users:(("evolution-data-",3522,23))
ESTAB 0 0 192.168.1.2:52701 64.12.104.29:aol users:(("pidgin",3220,7))
ESTAB 0 0 192.168.1.2:58629 74.125.127.191:www users:(("firefox",5652,66))
ESTAB 0 0 192.168.1.2:50324 64.4.34.34:msnp users:(("pidgin",3220,24))
ESTAB 0 0 192.168.1.2:41756 64.12.200.200:aol users:(("pidgin",3220,26))
ESTAB 0 0 192.168.1.2:46001 205.188.248.153:aol users:(("pidgin",3220,27))
ESTAB 0 0 192.168.1.2:56745 97.102.113.65:39196 users:(("skype",3275,25))
ESTAB 0 0 192.168.1.2:48318 68.180.217.22:mmcc users:(("pidgin",3220,22))
ESTAB 0 0 192.168.1.2:45615 208.82.32.2:https


ss -p | cut -f2 -sd\"

aggitan@Moneque:~$ ss -p | cut -f2 -sd\"
firefox
software-center
skype
evolution-data-
pidgin
firefox
pidgin
pidgin
pidgin
skype
pidgin


ss -p | grep STA | cut -f2 -d\"

aggitan@Moneque:~$ ss -p | grep STA | cut -f2 -d\"
evolution-data-
firefox
skype
pidgin
firefox
pidgin
pidgin
pidgin
skype
pidgin
ESTAB 0 0 192.168.1.2:45615 208.82.32.2:https




netstat -lantp | grep -i stab | awk -F/ '{print $2}' | sort | uniq

aggitan@Moneque:~$ netstat -lantp | grep -i stab | awk -F/ '{print $2}' | sort | uniq
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)

evolution-data
firefox
pidgin
skype


lsof -nPi | cut -f1 -d" " | sort -u

aggitan@Moneque:~$ lsof -nPi | cut -f1 -d" " | sort -u
COMMAND
evolution
firefox
pidgin
skype
software-


lsof -P -i -n

aggitan@Moneque:~$ lsof -P -i -n
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
software- 3165 aggitan 42u IPv4 17054 0t0 TCP 192.168.1.2:49530->91.189.89.31:80 (CLOSE_WAIT)
pidgin 3220 aggitan 7u IPv4 15717 0t0 TCP 192.168.1.2:52701->64.12.104.29:5190 (ESTABLISHED)
....
pidgin 3220 aggitan 27u IPv4 16065 0t0 TCP 192.168.1.2:46001->205.188.248.153:5190 (ESTABLISHED)
pidgin 3220 aggitan 28u IPv4 68682 0t0 TCP 192.168.1.2:33893->64.12.30.44:5190 (ESTABLISHED)
skype 3275 aggitan 21u IPv4 15556 0t0 UDP 127.0.0.1:54110
skype 3275 aggitan 22u IPv4 17137 0t0 TCP *:38228 (LISTEN)
skype 3275 aggitan 23u IPv4 17138 0t0 UDP *:38228
skype 3275 aggitan 25u IPv4 18201 0t0 TCP 192.168.1.2:56745->97.102.113.65:39196 (ESTABLISHED)
evolution 3522 aggitan 23u IPv4 84194 0t0 TCP 192.168.1.2:47782->74.125.19.104:443 (ESTABLISHED)
firefox 5652 aggitan 22u IPv4 83368 0t0 TCP 192.168.1.2:42311->74.125.127.97:443 (ESTABLISHED)
firefox 5652 aggitan 42u IPv4 83382 0t0 TCP 192.168.1.2:50066->74.125.127.132:443 (ESTABLISHED)
....
firefox 5652 aggitan 86u IPv4 85007 0t0 TCP 192.168.1.2:42467->74.125.127.133:80 (ESTABLISHED)
skype 5993 aggitan 21u IPv4 57559 0t0 UDP 127.0.0.1:49063
skype 5993 aggitan 22u IPv4 57648 0t0 TCP *:1219 (LISTEN)
skype 5993 aggitan 23u IPv4 57649 0t0 UDP *:1219
skype 5993 aggitan 28u IPv4 58655 0t0 TCP 192.168.1.2:37498->97.74.195.163:23314 (ESTABLISHED)


(11:52:02 AM) internet: netstat is good for that
(11:53:24 AM) aggitan: It's ugly.
(11:53:59 AM) aggitan: unless you grep it
(12:02:35 PM) aggitan: netstat | grep tcp
netstat | grep tcp

aggitan@Moneque:~$ netstat | grep tcp
tcp 0 0 Moneque.local:58623 pz-in-f191.1e100.ne:www ESTABLISHED
tcp 1 0 Moneque.local:49530 barbadine.canonical:www CLOSE_WAIT
tcp 0 0 Moneque.local:37498 ip-97-74-195-163.:23314 ESTABLISHED
tcp 0 0 Moneque.local:52701 bos-m085b-sdr2.blue:aol ESTABLISHED
tcp 0 0 Moneque.local:37518 nuq04s01-in-f104.:https ESTABLISHED
tcp 0 0 Moneque.local:50324 bay12-ts5.bay12.ho:msnp ESTABLISHED
tcp 0 0 Moneque.local:41756 buddychat-m01b.blue:aol ESTABLISHED
tcp 0 0 Moneque.local:46001 oam-d10b.blue.aol.c:aol ESTABLISHED
tcp 0 0 Moneque.local:56745 65.113.102.97.cfl:39196 ESTABLISHED
tcp 0 0 Moneque.local:48318 cs117.msg.sp1.yaho:mmcc ESTABLISHED
tcp 0 0 Moneque.local:45615 208.82.32.2:https ESTABLISHED
 
::Site Map::.....
    ♥Multi-Media
  • Photography
    • Sceanery
    • Commisioned
    • Wildlife
    • Miscellaneous
  • Graphics
    • 3D still renders
    • 'Shopped
    • WallPapers
    • Miscellaneous
  • Videos
    • 3D animetions
    • In r/l
    • pro-ductions
    • Miscellaneous
  • Audio
    • Sound Bites
    • Dope beats
    • Miscellaneous
    ♥Projects
  • Web
    • Jinkaku.net
    • This site
    Desktop
    • None now
    ♥About
  • Me
    • Education
    • Work EXP.
  • The Site
    • Design
    • Statistics
    ♥Language
  • Japanese
    • Phrases
    • Tips 'n tricks
    • vocabulary
  • Spanish
    • Phrases
    • Tips 'n tricks
    • vocabulary
  • Korean
    • Phrases
    • Tips 'n tricks
    • vocabulary
    ♥Miscellaneous
  • Links
    • Educational
    • Humor
    • cohorts
  • Badges