Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to kill the processes accessing Internet in background using terminal commands. Command to stop (disconnect) the processes accessing Internet. Command to kill the process accessing Internet.

share|improve this question
kill -9 'name_of_program_using_internet' – Nicholi Jul 28 '11 at 0:43
@Nicholi : But how to find processes accessing internet ? – JOHN Jul 28 '11 at 0:50
kill -15 is preferable, since programs designed to respond to the 15 argument will clean up before ending. – myopic.bones Jul 28 '11 at 0:59
up vote 4 down vote accepted

To find any processes making/listening for Internet connections run:

lsof -i

Output will be similar to this:

sshd       4236   root    3u  IPv4   13169      0t0  TCP *:ssh (LISTEN)
ntpd       4260    ntp   16u  IPv4   13192      0t0  UDP *:ntp 
ntpd       4260    ntp   17u  IPv4   13196      0t0  UDP localhost:ntp 
ntpd       4260    ntp   18u  IPv4   13197      0t0  UDP 
master     4431   root   12u  IPv4   13397      0t0  TCP localhost:smtp (LISTEN)
httpd2-pr  4493   root    3u  IPv4   13542      0t0  TCP *:http (LISTEN)

Now use kill with the PID of the processes as listed above, for example, to kill ssh above, run:

sudo kill -15 4236

If that doesn't help, run:

sudo kill -9 4236

Option -15 sends a TERM signal, which kindly asks the process to quit. Option -9 sends a KILL signal, which forces the process to immediately quit. Try -15 first, then -9.

share|improve this answer
thanks. is working – JOHN Jul 28 '11 at 3:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .