processes:kill_a_process_which_occupies_a_port
Differences
This shows you the differences between two versions of the page.
processes:kill_a_process_which_occupies_a_port [2016/12/07 16:18] – created peter | processes:kill_a_process_which_occupies_a_port [2019/12/01 22:36] (current) – removed peter | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Processes - Kill a process which occupies a port ====== | ||
- | |||
- | This example shows how to detect and kill a process running on port 500 on Ubuntu machine. | ||
- | |||
- | 1. Verify that port 500 is occupied on the machine: | ||
- | |||
- | <code bash> | ||
- | netstat -an | grep 500 | ||
- | </ | ||
- | |||
- | * **-a** is for listing active connections | ||
- | * **-n** is to disable DNS lookup and only show IP address. | ||
- | |||
- | |||
- | 2. Show the ID of the process that uses port 500: | ||
- | |||
- | <code bash> | ||
- | sudo fuser 500/udp | ||
- | </ | ||
- | |||
- | |||
- | 3. Kill the process: | ||
- | |||
- | <code bash> | ||
- | sudo fuser -k 500/udp | ||
- | </ | ||
processes/kill_a_process_which_occupies_a_port.1481127535.txt.gz · Last modified: 2020/07/15 09:30 (external edit)