How to Show All Running Processes in Linux
Thursday, March 29, 2018
How to Show All Running Processes in Linux :-
How to show all running process in Linux operating systems using command line or GUI options.
Linux commands to list processes :-
following commands to display info about processes on Linux:
top command : Display and update sorted information about processes.
atop command : Advanced System & Process Monitor.
htop command : Interactive process viewer.
pgrep command : Look up or signal processes based on name and other attributes.
pstree command : Display a tree of processes.
How to list process with the ps command :-
following ps command to display all running process:
# ps -aux | less
OR
# ps aux | less
Where,
A : Select all processes
u : Select all processes on a terminal, including those of other users
x : Select processes without controlling ttys
How To See every process on the Linux system :-
Either pass -A or -e option to show all processes on your server/workstation powered by Linux:
# ps -A
# ps -e
How to see every process except those running as root :-
To negates the selection pass the -N or --deselect option to the ps command:
# ps -U root -u root -N
OR
# ps -U root -u root --deselect
How to See process run by user xyz :-
Select by process by effective user ID (EUID) or name by passing username such as xyz:
# ps -u xyz
Linux running processes with top command :-
The top program provides a dynamic real-time view of a running system. Type the top at command prompt:
# top
How to display a tree of processes :-
The pstree command shows running processes as a tree. The tree is rooted at either pid or init if pid is omitted. If a user name is specified, all process trees rooted at processes owned by that user are shown.
$ pstree
Print a process tree using ps :-
# ps -ejH
# ps axjf
How to Get info about threads using following command :-
Type the following command:
# ps -eLf
# ps axms
How to show Task: Get security info :-
Type the following command:
# ps -eo euser,ruser,suser,fuser,f,comm,label
# ps axZ
# ps -eM
How to save process snapshot to a file :-
Type the following command:
# top -b -n1 > /tmp/process.log
Or you can email result to yourself : -
# top -b -n1 | mail -s 'Process snapshot' you@example.com
How to lookup process by name :-
Use pgrep command command. It looks through the currently running processes and lists the process IDs which matches the selection criteria to screen. For example, display firefox process id:
$ pgrep firefox
Sample outputs:
3356
Following command will list the process called sshd which is owned by a user called root:
$ pgrep -u root sshd
0 comments:
Post a Comment