Linux ps Shows Current Processes | How To Identify Process ID pidof

By through ps command we can identify the process Id and then using kill command we can able terminate that process.

ps u username
rpmsupport-4 ~/Desktop $ ps U support
PID TTY STAT TIME COMMAND
3352 ? Sl 0:00 /usr/bin/gnome-keyring-daemon --daemonize --login
3365 ? Ssl 0:00 x-session-manager
3428 ? Ss 0:00 /usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-s
3431 ? S 0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/pul
3432 ? Ss 0:00 //bin/dbus-daemon --fork --print-

ps -aux x for user
print the process with process id for specified user
rpmsupport-4 ~/Desktop $ ps -ausupport
PID TTY TIME CMD
3352 ? 00:00:00 gnome-keyring-d
3365 ? 00:00:00 x-session-manag
3428 ? 00:00:00 ssh-agent
3431 ? 00:00:00 dbus-launch
3432 ? 00:00:00 dbus-daemon
3437 ? 00:00:00 pulseaudio
3438 ? 00:00:00 gconf-helper
3440 ? 00:00:01 gconfd-2
3451 ? 00:00:00 seahorse-agent
3454 ? 00:00:00 gvfsd
3460 ? 00:00:00 gvfs-fuse-daem


Find the Process ID using pidof  Command
bash@kill-4 ~/Desktop $ pidof man
6412 3020
bash@kill-4 ~/Desktop $ pidof xinit
6554
bash@kill-4 ~/Desktop $ pidof top
6556
Using Pidof command we can identify the process id directly without any issue.
Some process it has the more than one process id.

Related post