└── README.md /README.md: -------------------------------------------------------------------------------- 1 | # Useful Linux Commands 2 | This repository stores Linux commands I find very useful in my case. This may help others as well. 3 | 4 | ## Kill Process By Port Number 5 | This command kills a process bound to a specified port (``). It is recommended to run this command as root via `sudo`. 6 | 7 | ```bash 8 | PORT= 9 | kill $(sudo lsof -t -i:$PORT) 10 | ``` 11 | 12 | ## Current CPU Clock Speed 13 | This command outputs the current clock speed of each CPU in MHz and updates the output every second. 14 | 15 | ```bash 16 | watch -n 1 'cat /proc/cpuinfo | grep "MHz"' 17 | ``` 18 | 19 | ## Kill All Processes Matching Process Name 20 | This command kills all processes that matches a process name. 21 | 22 | ```bash 23 | NAME="" 24 | kill -9 $(pgrep -f $NAME) 25 | ``` 26 | --------------------------------------------------------------------------------