Information about services/processes & PID
The compiled commands listed below utilizes a few tools: ps, ss, lsof & pgrep. More details about these tools can be found in the individual pages above.
** TO CONTEMPLATE ABOUT THE COMMANDS WHICH REQUIRES SUDO
Find processes by service name
$ pgrep -l <service-name>
# eg. To find PID (Process ID) associated with SSHD (SSH Daesmon)
$ pgrep -l sshdRetrieve information about a specific PID
$ ps -p <PID>
$ ps -p <PID> -o pid, cmd # To only display relevant informationIdentify the port number related to a PID or service name
Last updated