Below are some important commands which can be used to check the processes in Linux system.
1: PS command : ps stand for processes in Linux. you can use this command with various options to check the processes running in the system & manage them. Below are some common use of ps command.
a) If you run only 'ps' command it will show only current executed process by you.
b) If you want to check every single process running under the system
$'ps -e'
You can use 'ps -ef , ps -eF , ps -ely' options to get detailed information about all processes.
c) If you want to check all running process in hierarchy format.
$ ps -ejH or ps -axjf
d) If you want to check process with their exact path location .
$ 'ps -eLf'
e) To see every process running as root in user format , run command
$ ps -U root -u root u
f) To see every process as user defined options.
$ ps eo pid, tid, class, rtprio, ni, pri, pcpu, stat, comm
put options given with command to see related output.
g) To see the process id of any specific process with 'ps' command
$ ps -C sshd -o pid=
you can see the process name with the process id
$ ps -q 1806 -o comm=
2:TOP Command :
type 'h' for help or 'q' any time to quit.
z > for color
E/e > get summary in human readable format
l > show load average row
t > show task average row
m > show memory average row
0 > to hide zero values
F/f > add or remove fields in top column
L > find specific process
& > find again
V > forest view/hierarchy
r> renice process
k > kill the process
U/u > specific user processes
3) Nice/Renice commands:
This will start top command with high priority. nice value range is -20 to +20. where -20 is highest and +20 is lowest. you can set any priority between these two values.
renice command is use to change the priority of already running process in system , you can use with pid ,gid , userid
renice -n 'priority_number' -p | -u | -g
0 Comments