Www.linuxidc.com @ linuxidc :~ $ Sudonetstat-antup [sudo] passwordforliujl: Activate the Internet connection (the server and the established connection) ProtoRecv-QSend-QLocalAddressForeig
Www.linuxidc.com @ linuxidc :~ $ Sudo netstat-antup
[Sudo] password for liujl:
Activate Internet connections (servers and established connections)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
Tcp 0 0 0.0.0.0: 24101 0.0.0.0: * LISTEN 10459/qq
Tcp 0 0 127.0.0.1: 7634 0.0.0.0: * LISTEN 15995/hddtemp
Tcp 0 0 127.0.0.1: 631 0.0.0.0: * LISTEN 1438/cupsd
Tcp 1 0 10.10.86.114: 46676 212.58.224.89: 80 CLOSE_WAIT 14323/gvfsd-http
Tcp 0 0 127.0.0.1: 7634 127.0.0.1: 36612 TIME_WAIT-
Tcp 0 0 10.10.86.114: 47933 202.108.23.238: 80 ESTABLISHED 2261/firefox
Tcp 0 0 127.0.0.1: 24101 127.0.0.1: 52166 ESTABLISHED
... ...
PID indicates the number of the Remote Process on the port.
# Sudo kill PID (Process Code)
Www.linuxidc.com @ linuxidc :~ $ Ps-e
PID TTY TIME CMD
1? 00:00:01 init
2? 00:00:00 kthreadd
3? 00:00:00 migration/0
4? 00:00:00 ksoftirqd/0
5? 00:00:00 watchdog/0
6? 00:00:00 migration/1
7? 00:00:02 ksoftirqd/1
8? 00:00:00 watchdog/1
9? 00:00:00 events/0
10? 00:00:00 events/1
11? 00:00:00 cpuset
12? 00:00:00 khelper
13? 00:00:00 netns
... Check the process numbers of all programs.
The descriptions are listed below:
Www.linuxidc.com @ linuxidc :~ $ Ps -- help
* ******** Simple selection ********************* selection by list ******** *
-A all processes-C by command name
-N negate selection-G by real group ID (supports names)
-A all w/tty handle T session leaders-U by real user ID (supports names)
-D all privileges t session leaders-g by session OR by valid tive group name
-E all processes-p by process ID
T all processes on this terminal-s processes in the sessions given
A all w/tty, including other users-t by tty
G OBSOLETE -- do not use-u by valid tive user ID (supports names)
R only running processes U processes for specified users
X processes w/o controlling ttys t by tty
* *********** Output format ************************ long options **** *******
-O, o user-defined-f full -- Group -- User -- pid -- cols -- ppid
-J, j job control s signal -- group -- user -- sid -- rows -- info
-O, O preloaded-o v virtual memory -- cumulative -- format -- deselect
-L, l long u user-oriented -- sort -- tty -- forest -- version
-F extra full X registers -- heading -- no-heading -- context
* ******** Misc options *********
-V, V show version L list format codes f ASCII art forest
-M, m,-L,-T, H threads S children in sum-y change-l format
-M, Z security data c true command name-c scheduling class
-W, w wide output n numeric WCHAN, UID-H process hierarchy