Subject: Linux Administrator Exp
No. 8
Aim of the Experiment: To monitoring and managing Linux process
Software Required:
1. VMware
2. Rhel 7.0
Theory:
Process:
A
process is nothing but, a running instance of a launched, executable program. Process
has life that’s why it needs resources. Like files, cpu, resister, stack ,PC,
webcam, Printer etc…
Program:
It
is a set of instruction, written in a programming language and saved in a file.
Programs are written to solve real time problem. Program is in-active (passive)
in nature that’s why it has no life. It does not need any resources.
- Foreground Processes: They
run on the screen and need input from the user.
- Background Processes: They
run in the background and usually do not need user input.
Implementation/Steps:
Suppose, I am playing a
music with banshee player #banshee
To
stop the running command, press #(ctrl+z)
To
continue it and take it in foreground #fg
banshee
To see all running process
on the Linux machine #top
It will appear something like this:
To move out of the process display: press ‘q’
Terminologies: -
Field |
Description |
Example 1 |
Example 2 |
PID |
The process ID of
each task |
2952 |
6219 |
User |
The username of task
owner |
root |
root |
PR |
Priority Can be 20(highest)
or -20(lowest) |
20 |
20 |
NI |
The nice value of a
task |
0 |
0 |
VIRT |
Virtual memory used (kb) |
1707420 |
123924 |
RES |
Physical memory used
(kb) |
244988 |
1924 |
SHR |
Shared memory used
(kb) |
39056 |
1152 |
S |
Status There are five
types: ‘D’ =
uninterruptible sleep ‘R’ = running ‘S’ = sleeping ‘T’ = traced or
stopped ‘Z’ = zombie |
S |
R |
%CPU |
% of CPU time |
3.3 |
0.7 |
%MEM |
Physical memory used |
6.3 |
0.0 |
TIME+ |
Total CPU time |
2:53.42 |
0:00.0.6 |
Command |
Command name |
Gnome-shell |
top |
To check all the processes running under a user #ps ux
To check process status of a single process #ps 1268
To terminate
a running process kill 1268
To know the PID of a command (Xorg) #pidof Xorg
To terminate/kill all running process #killall
NICE
Linux
can run a lot of processes at a time, which can slow down the speed of some
high priority processes and result in poor performance. To tell our machine to
prioritize processes as per our requirements.
nice has a value between -20 to 19. The lower the
Niceness index, the higher would be a priority given to that task.
The default value of all the
processes is 0.
To renice the value #renice 20-p 2952
#renice ‘nice value’ –p ‘PID’
To check the free disk space
on all file system #df
To see free disk space in
readable form #df –h
Conclusion:
In
this experiment I know about process, fore-ground, back-ground process, about
job of the processes, to kill the running process, to renice the processes, and
to see the storage etc.
`
إرسال تعليق