Process Command In Linux

Chapter: Linux Commands Last Updated: 16-11-2019 17:28:08 UTC

Program:

            /* ............... START ............... */
                
[email protected]:~$ ps -a | grep -i "firefox"  // ps command is used to view process and grep command to search for firefox process
 31721 tty2     00:00:06 firefox

[email protected]:~$ ps -a
   PID TTY          TIME CMD
   871 tty1     00:00:00 gnome-session-b
   886 tty1     00:00:04 gnome-shell
  1171 tty1     00:00:09 Xwayland
  1333 tty1     00:00:00 ibus-daemon
  1394 tty1     00:00:00 ibus-dconf
  1399 tty1     00:00:00 ibus-x11
  1421 tty1     00:00:00 gsd-xsettings
  1422 tty1     00:00:00 gsd-a11y-settin
  1427 tty1     00:00:00 gsd-clipboard
  1428 tty1     00:00:00 gsd-color
  ...........
  ...........


[email protected]:~$ pgrep firefox // pgrep command is used to get the process id running process.
31721

                /* ............... END ............... */
        

Output


Process Command In Linux

Notes:

  • Command in linux to view running process is "ps". When typing ps command in linux it will list all the current running process.
  • ps -a will all the list of details of task running in the system with name.
  • Syntax : ps [options]
  • Another command to get the process id of running process is "pgrep", by using the command you will get the process number of running process. For example if you type pgrep firefox, it will show the process number of firefox running. If you want to kill the process you can type "kill processNumber".
  • For more information you can check the manual of command by typing man ps.
  • If you want to search particular process, you can search process by using grep command after the process command.
  • For example if you want to search firefox you can ps -a | grep -i "firefox" then it will list all running process which contains firefox.

Tags

Process Command In Linux, how to check running process in linux, Command to view running Process in linux

Similar Programs Chapter Last Updated
Unzip Command In Linux Linux Commands 20-11-2019
Linux Command To Create Link Linux Commands 15-11-2019
Linux Command To View File Content Linux Commands 25-10-2019
Linux Command To Check OS Version Linux Commands 25-10-2019
Netstat Command In Linux Linux Commands 13-08-2019
Telnet Command In Linux Linux Commands 13-08-2019
Linux Command To Create A File Linux Commands 23-05-2019
Linux echo Command Linux Commands 05-05-2018
Linux Ping Command Linux Commands 05-05-2018
Linux ls (List Directory) Command Linux Commands 17-03-2018

1