📜  archlinux free used port - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:05.006000             🧑  作者: Mango

代码示例1
// Install lsof package (example for archlinux)
sudo pacman -S lsof 

// List ports that are being used
sudo lsof -i -P -n | grep LISTEN

// lsof output example, the 2nd value is the process id (6951)
Discord   6951 damian   49u  IPv4  47939      0t0  TCP 127.0.0.1:6463 (LISTEN)

// kill the process
kill 6951