gamemann / Useful-Linux-Commands

Just a repository I'm using to store useful Linux commands to me and possibly others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Useful Linux Commands

This repository stores Linux commands I find very useful in my case. This may help others as well.

Kill Process By Port Number

This command kills a process bound to a specified port (<PORT>). It is recommended to run this command as root via sudo.

PORT=<port>
kill $(sudo lsof -t -i:$PORT)

Current CPU Clock Speed

This command outputs the current clock speed of each CPU in MHz and updates the output every second.

watch -n 1 'cat /proc/cpuinfo | grep "MHz"'

Kill All Processes Matching Process Name

This command kills all processes that matches a process name.

NAME=""
kill -9 $(pgrep -f $NAME)

About

Just a repository I'm using to store useful Linux commands to me and possibly others.