https://github.com/syaifulahdan/os­practice|Operating System Practice |1 to 45 
OPERATING SYSTEMS PRACTICE
Process and Management Process
Practice : 4A

Process on Linux Operating System

Process Management on Linux Operating Systems
https://github.com/syaifulahdan/os­practice|
https://github.com/syaifulahdan/os­practice|Operating System Practice |2 to 45 
A. Objectives
1. Understand the process concepts in Linux operating system.
2. Shows some ways of showing parent and child process
relationships.
3. Displays the status of a process with several different formats.
4. Controlling the process on the shell.
5. Understanding priority scheduling.
https://github.com/syaifulahdan/os­practice|Operating System Practice |3 to 45 
B. Basic Theory
https://github.com/syaifulahdan/os­practice|Operating System Practice |4 to 45 
1. Concept Proces on linux OS

Process is the program being executed.

Whenever using the system utility or application
program from the shell, one or more "child" processes
will be created by the shell according to the given
command.

Each time the instruction is given in the Linux shell, the
kernel creates an id-process.

This process is also called the Unix terminology as a
Job.

The process Id (PID) starts from 0, the INIT process,
followed by the next process (listed in /etc 
/inittab).
https://github.com/syaifulahdan/os­practice|Operating System Practice |5 to 45 

Several types of processes:

Foreground
Processes created by the user directly at the terminal
(interactive, dialog)

Batch
Processes are collected and executed sequentially (one by
one). Batch Prose is not associated (interacting) with terminal.

Daemon
Processes that wait for requests from other processes and
perform tasks according to the request.
If there is no request, then this program will be in "idle" and do
not use CPU count time. Generally the name of the daemon
process in UNIX ends in d, for example inetd,  named, 
popd etc.
https://github.com/syaifulahdan/os­practice|Operating System Practice |6 to 45 
2. Signal
The process can send and receive signals from and to
other processes. The process of sending a signal
through the instruction "kill" with the format.
kill [­nomor sinyal] PID
Signal number: 1 to maximum signal number defined by
system The most important signal number standard is:
https://github.com/syaifulahdan/os­practice|Operating System Practice |7 to 45 
No Signal Name Description
1 SIGHUP
Hangup, signals are sent when the process
is disconnected, for example through the
breaking of the modem connection
2 SIGINT Interrupt signal, through ^ C
3 SIGQUIT Quit signal, via ^ 
9 SIGKILL Signal Kill, stop the process
15 SIGTERM Software termination signals
https://github.com/syaifulahdan/os­practice|Operating System Practice |8 to 45 
3. Sending Signal
Sending a signal is a communication tool between processes,
which tells the ongoing process that something must be
controlled. Based on the signal sent this process can react and
the administrator / programmer can determine the reaction.
Sending signals using instructions
kill [­nomor sinyal] PID
Before sending the PID signal the process to be sent must be
known first.
https://github.com/syaifulahdan/os­practice|Operating System Practice |9 to 45 
4. Control Process on Shell

Shell provides a job control facility that allows control of
multiple jobs or processes that are running at the same
time.

For example when doing text file editing and want to do
interrupt editing to do other things.

When done, can return (switch) to the editor and do the text
file editing again.

Job works on foreground or background.

In foreground only for one job at a time.

Job on the foreground will control the shell - receive input
from the keyboard and send output to the screen.

The job in the background does not accept input from the
terminal, usually running without requiring interaction.
https://github.com/syaifulahdan/os­practice|Operating System Practice |10 to 45 

Job on the foreground may be suspended, with press [Ctrl-
Z].

A paused job can be re-run in the foreground or background
as needed by pressing "fg" or "bg".

For the record, stopping a temporary job is very different
from doing an interrupt job (usually using [Ctrl-C]), where
the interrupted job will be permanently disabled and can not
be executed again.
https://github.com/syaifulahdan/os­practice|Operating System Practice |11 to 45 
5. Control Other Process

The ps command can be used to indicate all running
processes on the machine (not just processes in the current
shell) with the format :
ps –fae or
ps ­aux

Some versions of UNIX have a so-called top system utility
that provides an interactive way to monitor system activity.

Statistics in detail with running processes are displayed and
continually refreshed. The process is displayed in sequence
from the CPU utility. A useful key on the top is
https://github.com/syaifulahdan/os­practice|Operating System Practice |12 to 45 
s – set update frequency
u – display proses dari satu user
k – kill proses (dengan PID)
q – quit
The utility for performing process controls can be found on
UNIX systems is the killall command. This command will
stop the process according to PID or job number process.
https://github.com/syaifulahdan/os­practice|Operating System Practice |13 to 45 
C. Step by Step
https://github.com/syaifulahdan/os­practice|Operating System Practice |14 to 45 
1 Login as user.
2
Download the C ++ program to display primes
named primes.
3
Conduct the experiments below and then analyze
the experimental results.
4 Complete the practice questions.
https://github.com/syaifulahdan/os­practice|Operating System Practice |15 to 45 
D. Experiment
https://github.com/syaifulahdan/os­practice|Operating System Practice |16 to 45 
$ ps
Experiment 1 : Process Status
1. Move to the command line terminal (tty2) by
pressing Ctrl + Alt + F2 and login to terminal as user.
2. The ps (process status) instruction is used to view
the process conditions. PID is the Process Identity
Number, TTY is the terminal name where the process
is active, STAT contains S (Sleeping) and R (Running),
COMMAND is the instruction used.
https://github.com/syaifulahdan/os­practice|Operating System Practice |17 to 45 
$ ps -u
3. To see other factors / elements, use the -u (user)
option. %CPU is the CPU time presentation used by
the process, %MEM is the memory system
presentation used by the process, SIZE is the sum
memory used, RSS (Real System Storage) is the
amount of memory used, START is when the process is
enabled...
4. Looking for user-specific processes. The above
process is only limited to the user process, where the
user is logged in.
$ ps -u
$ ps –u <user>
https://github.com/syaifulahdan/os­practice|Operating System Practice |18 to 45 
5. Looking for other processes use the a (all) and au
(all user) options
6. Logout and press Alt + F7 to return to graphics
mode
$ ps –a
$ ps –au
https://github.com/syaifulahdan/os­practice|Operating System Practice |19 to 45 
Experiment 2 : Displays the Parent
and Child Process Relationships
1. Move to command line terminal (tty2) by pressing
Ctrl + Alt + F2 and login to terminal as user.
2. Type ps -eH and press Enter. Option e selects all
processes and options H produce a hierarchical
process view. The child process appears below parent
rocess. The child process is marked by multiple spaces.
$ ps ­eH
https://github.com/syaifulahdan/os­practice|Operating System Practice |20 to 45 
$ ps –e f
3. Type ps -e f and press Enter. The view is similar
to step 2. The -f option will display the status of the
process with graphic characters ( and _ )
4. Type pstree and press Enter. Will show all
processes on the system in the form of parent / child
hierarchy. Process the parent to the left of the child
process. For example the init process as a parent
(ancestor) of all processes on the system. Some child
from init has a child. Login process has bash process
as child. The bash process has a child startx process.
The startx process has child xinit and so on.
$ pstree
https://github.com/syaifulahdan/os­practice|Operating System Practice |21 to 45 
$ pstree | grep mingetty
5. Type pstree | grep mingetty and press Enter. Will
show all the mingetty process that runs on the system
in the form of virtual console. In addition to displaying all
processes, the process is grouped in a row with a
number as the number of running processes.
6. To view all PIDs for the process use the ­p option.
$ pstree –p
7. To show the process and ancestor in bold use option
­h.
$ pstree –h
https://github.com/syaifulahdan/os­practice|Operating System Practice |22 to 45 
$ ps -e | more
Experiment 3 : Displays the Status of
Processes with Different Formats
1. Move to command line terminal (tty2) by pressing
Ctrl + Alt + F2 and login to terminal as user.
2. Type ps -e | more and press Enter. The -e option
displays all processes in the form of 4 columns: PID, TTY,
TIME and CMD.
If the full page shows a prompt --More-- at the bottom of the
screen, press q to return to the command prompt....
https://github.com/syaifulahdan/os­practice|Operating System Practice |23 to 45 
3. Type ps ax | more and press Enter. Option a will
show all processes the resulting terminal (TTY).
The x option displays all processes the terminal does
not generate.
Logically this option is the same as the -e option.
There are 5 columns: PID, TTY, STAT, TIME and
COMMAND.
$ ps ax | more
If the full page shows a prompt --More-- at the
bottom of the screen, press q to return to the
command prompt....
https://github.com/syaifulahdan/os­practice|Operating System Practice |24 to 45 
4. Type ps -e f | more and press Enter. The -e f
option will display all processes in full list format.
$ ps ef | more
If the full page shows a prompt --More-- at the
bottom of the screen, press q to return to the
command prompt....
5. Type ps -eo pid, cmd | more and press Enter.
The -eo option will display all processes in the format
according to the user definition that consists of PID
and CMD columns.
$ ps –eo pid,cmd | more
https://github.com/syaifulahdan/os­practice|Operating System Practice |25 to 45 
If the full page shows a prompt --More-- at the
bottom of the screen, press q to return to the
command prompt....
6. Type ps -eo pid, ppid,% mem, cmd | more and
press Enter. Will display PID, PPID and% MEM columns.
PPID is the process ID of the parent process.
% MEM displays the percentage of memory system
used by the process. If the process uses only a small
amount of memory the system will get 0.
$ ps –eo pid,ppid,%mem,cmd | more
7. Logout and press Alt + F7 to return to graphics mode
https://github.com/syaifulahdan/os­practice|Operating System Practice |26 to 45 
$ yes
Experiment 4 : Control the process
on the shell.
1. Move to command line terminal (tty2) by pressing
Ctrl + Alt + F2 and login to terminal as user
2. Use the yes command that sends output y that never
stops
To stop it use Ctrl-C.
https://github.com/syaifulahdan/os­practice|Operating System Practice |27 to 45 
3. Turn standard output to /dev /null.
$ yes > /dev/null
If the full page shows a prompt --More-- at the
bottom of the screen, press q to return to the
command prompt....
To stop it use Ctrl-C.
4. One way to keep the yes command running but
the shell is still used for something else by putting
the process in the background by adding characters
& at the end of the command
$ yes > /dev/null &
The number in "[ ]" is a job number followed by PID.
https://github.com/syaifulahdan/os­practice|Operating System Practice |28 to 45 
5. To view the status of the process use the jobs
command.
$ jobs
6. To stop a job, use the kill command followed by
the job number or PID process. To identify job
number, followed by prefix with character "%".
$ kill %<nomor job> contoh: kill %1
7. View job status after termination
$ jobs
https://github.com/syaifulahdan/os­practice|Operating System Practice |29 to 45 
E. Exercise
https://github.com/syaifulahdan/os­practice|Operating System Practice |30 to 45 

Exercise : Practice 4A
1 Try the following command:
 
 $ ps
 $ ps ­u
 $ ps ­u <user>
 $ ps au
 $ ps ­eH
 $ ps ­e f
 $ pstree
 $ ps ­e | more
 $ ps ax | more
 $ ps ­ef | more
 $ jobs
 $ kill %<jobs number>
 
https://github.com/syaifulahdan/os­practice|Operating System Practice |31 to 45 

Practice Report : Practice 4A
1 Analyze your experimental results.
2 Analyze the exercises that have been done.
3 Give a conclusion from this lab.
Command Descripton
ps
ps ­u
ps ­u <user>
ps ­eH
pstree
jobs
kill %<jobs number>
https://github.com/syaifulahdan/os­practice|Operating System Practice |32 to 45 

“Pleasure in a job makes perfection on the results 
achieved”. Aristoteles

“Believe you can. You're halfway”. Theodore Roosevelt

“You might be able to delay, but time will not wait”. 
Benjamin Franklin 

“The effort will work if someone does not give up”. 
Napoleon Hill

“Opportunity to find a better strength in us arises 
when life seems to be very challenging”. Joseph 
Campbell

More Related Content

PDF
Lab report 201001067_201001104
PDF
Operating System-Ch6 process synchronization
ODP
Presentation automatic deployment with TYPO3v4
PPT
Chapter 6 - Process Synchronization
PPT
Operating Systems - "Chapter 5 Process Synchronization"
PDF
ThoughtWorks Tech Talks NYC: DevOops, 10 Ops Things You Might Have Forgotten ...
PDF
Synchronization
PPTX
Concurrency: Mutual Exclusion and Synchronization
Lab report 201001067_201001104
Operating System-Ch6 process synchronization
Presentation automatic deployment with TYPO3v4
Chapter 6 - Process Synchronization
Operating Systems - "Chapter 5 Process Synchronization"
ThoughtWorks Tech Talks NYC: DevOops, 10 Ops Things You Might Have Forgotten ...
Synchronization
Concurrency: Mutual Exclusion and Synchronization

What's hot (10)

PDF
Monitors
PPTX
Process synchronization in operating system
PPT
Ch7 Process Synchronization galvin
PPT
Lec11 semaphores
PPTX
Synchronization hardware
PDF
How to build a feedback loop in software
PPTX
SYNCHRONIZATION
PPT
Process synchronization(deepa)
PPT
Operating System - Monitors (Presentation)
PDF
Operating Systems - Process Synchronization and Deadlocks
Monitors
Process synchronization in operating system
Ch7 Process Synchronization galvin
Lec11 semaphores
Synchronization hardware
How to build a feedback loop in software
SYNCHRONIZATION
Process synchronization(deepa)
Operating System - Monitors (Presentation)
Operating Systems - Process Synchronization and Deadlocks
Ad

Similar to Operating System Practice : Meeting 5- process and manajemen proces-a-slide (20)

PDF
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
PPTX
Linux system administration
PPTX
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
PDF
System calls
DOCX
InstructionsInstructions for numberguessernumberGuesser.html.docx
PPT
3.5 create, monitor and kill processes v2
PPTX
UNIX Notes
PDF
Operating System Practice : Meeting 8- bekerja dengan bash shell-b-slide
DOCX
LP-Unit3.docx
PPT
11_UNIX_Processes_Including_Select.ppt
PDF
Operating System Practice : Meeting 3 - operasi input output-slide
PPT
PPTX
04_ForkPipe.pptx
PPTX
13 process management
PPTX
Linux Systems Programming: Process CommunCh11 Processes and Signals
PPTX
System Administration: Linux Process
PDF
Linux Internals - Part II
PDF
Process management
Operating System Practice : Meeting 6- process and manajemen proces-b-slide
Linux system administration
578781849-RHSA-1-Chap578781850-RHSA-1-Chapter-4ter-7.pptx
System calls
InstructionsInstructions for numberguessernumberGuesser.html.docx
3.5 create, monitor and kill processes v2
UNIX Notes
Operating System Practice : Meeting 8- bekerja dengan bash shell-b-slide
LP-Unit3.docx
11_UNIX_Processes_Including_Select.ppt
Operating System Practice : Meeting 3 - operasi input output-slide
04_ForkPipe.pptx
13 process management
Linux Systems Programming: Process CommunCh11 Processes and Signals
System Administration: Linux Process
Linux Internals - Part II
Process management
Ad

More from Syaiful Ahdan (20)

PDF
Sertifikat EC00202128391
PDF
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
PDF
Sertifikat ec00202059774
PDF
Sertifikat ec00202059775
PDF
Sertifikat EC00202045078
PDF
Sertifikat EC00202044723
PDF
Sertifikat EC00202023523
PDF
Sertifikat EC00201826309
PDF
Sertifikat EC00202023149
PDF
Sertifikat EC00202022868
PDF
Sertifikat EC00202021343
PDF
Sertifikat EC00202022755
PDF
Sertifikat EC00201987196
PDF
Sertifikat EC00201856484
PDF
Sertifikat EC00201856352
PDF
Sertifikat EC00201856994
PDF
Sertifikat EC00201856895
PDF
Meeting 2 introdcution network administrator
PDF
Pertemuan 5
PDF
Pertemuan 4
Sertifikat EC00202128391
SP2JPB - Aplikasi Sistem Pelayanan Pemesanan Jasa Perbaikan Pada Bengkel Alam...
Sertifikat ec00202059774
Sertifikat ec00202059775
Sertifikat EC00202045078
Sertifikat EC00202044723
Sertifikat EC00202023523
Sertifikat EC00201826309
Sertifikat EC00202023149
Sertifikat EC00202022868
Sertifikat EC00202021343
Sertifikat EC00202022755
Sertifikat EC00201987196
Sertifikat EC00201856484
Sertifikat EC00201856352
Sertifikat EC00201856994
Sertifikat EC00201856895
Meeting 2 introdcution network administrator
Pertemuan 5
Pertemuan 4

Recently uploaded (20)

PDF
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
PDF
Empowerment Technology for Senior High School Guide
PDF
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
PDF
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
PDF
Weekly quiz Compilation Jan -July 25.pdf
PPTX
Unit 4 Computer Architecture Multicore Processor.pptx
PPTX
Share_Module_2_Power_conflict_and_negotiation.pptx
PPTX
History, Philosophy and sociology of education (1).pptx
PDF
My India Quiz Book_20210205121199924.pdf
PDF
What if we spent less time fighting change, and more time building what’s rig...
PDF
Trump Administration's workforce development strategy
PDF
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
PDF
Paper A Mock Exam 9_ Attempt review.pdf.
PPTX
20th Century Theater, Methods, History.pptx
PDF
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
PPTX
Introduction to pro and eukaryotes and differences.pptx
DOCX
Cambridge-Practice-Tests-for-IELTS-12.docx
PPTX
TNA_Presentation-1-Final(SAVE)) (1).pptx
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
FORM 1 BIOLOGY MIND MAPS and their schemes
BP 704 T. NOVEL DRUG DELIVERY SYSTEMS (UNIT 1)
Empowerment Technology for Senior High School Guide
FOISHS ANNUAL IMPLEMENTATION PLAN 2025.pdf
MBA _Common_ 2nd year Syllabus _2021-22_.pdf
Weekly quiz Compilation Jan -July 25.pdf
Unit 4 Computer Architecture Multicore Processor.pptx
Share_Module_2_Power_conflict_and_negotiation.pptx
History, Philosophy and sociology of education (1).pptx
My India Quiz Book_20210205121199924.pdf
What if we spent less time fighting change, and more time building what’s rig...
Trump Administration's workforce development strategy
Τίμαιος είναι φιλοσοφικός διάλογος του Πλάτωνα
Paper A Mock Exam 9_ Attempt review.pdf.
20th Century Theater, Methods, History.pptx
CISA (Certified Information Systems Auditor) Domain-Wise Summary.pdf
Introduction to pro and eukaryotes and differences.pptx
Cambridge-Practice-Tests-for-IELTS-12.docx
TNA_Presentation-1-Final(SAVE)) (1).pptx
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
FORM 1 BIOLOGY MIND MAPS and their schemes

Operating System Practice : Meeting 5- process and manajemen proces-a-slide

  • 1. https://github.com/syaifulahdan/os­practice|Operating System Practice |1 to 45  OPERATING SYSTEMS PRACTICE Process and Management Process Practice : 4A  Process on Linux Operating System  Process Management on Linux Operating Systems https://github.com/syaifulahdan/os­practice|
  • 2. https://github.com/syaifulahdan/os­practice|Operating System Practice |2 to 45  A. Objectives 1. Understand the process concepts in Linux operating system. 2. Shows some ways of showing parent and child process relationships. 3. Displays the status of a process with several different formats. 4. Controlling the process on the shell. 5. Understanding priority scheduling.
  • 4. https://github.com/syaifulahdan/os­practice|Operating System Practice |4 to 45  1. Concept Proces on linux OS  Process is the program being executed.  Whenever using the system utility or application program from the shell, one or more "child" processes will be created by the shell according to the given command.  Each time the instruction is given in the Linux shell, the kernel creates an id-process.  This process is also called the Unix terminology as a Job.  The process Id (PID) starts from 0, the INIT process, followed by the next process (listed in /etc  /inittab).
  • 5. https://github.com/syaifulahdan/os­practice|Operating System Practice |5 to 45   Several types of processes:  Foreground Processes created by the user directly at the terminal (interactive, dialog)  Batch Processes are collected and executed sequentially (one by one). Batch Prose is not associated (interacting) with terminal.  Daemon Processes that wait for requests from other processes and perform tasks according to the request. If there is no request, then this program will be in "idle" and do not use CPU count time. Generally the name of the daemon process in UNIX ends in d, for example inetd,  named,  popd etc.
  • 6. https://github.com/syaifulahdan/os­practice|Operating System Practice |6 to 45  2. Signal The process can send and receive signals from and to other processes. The process of sending a signal through the instruction "kill" with the format. kill [­nomor sinyal] PID Signal number: 1 to maximum signal number defined by system The most important signal number standard is:
  • 7. https://github.com/syaifulahdan/os­practice|Operating System Practice |7 to 45  No Signal Name Description 1 SIGHUP Hangup, signals are sent when the process is disconnected, for example through the breaking of the modem connection 2 SIGINT Interrupt signal, through ^ C 3 SIGQUIT Quit signal, via ^ 9 SIGKILL Signal Kill, stop the process 15 SIGTERM Software termination signals
  • 8. https://github.com/syaifulahdan/os­practice|Operating System Practice |8 to 45  3. Sending Signal Sending a signal is a communication tool between processes, which tells the ongoing process that something must be controlled. Based on the signal sent this process can react and the administrator / programmer can determine the reaction. Sending signals using instructions kill [­nomor sinyal] PID Before sending the PID signal the process to be sent must be known first.
  • 9. https://github.com/syaifulahdan/os­practice|Operating System Practice |9 to 45  4. Control Process on Shell  Shell provides a job control facility that allows control of multiple jobs or processes that are running at the same time.  For example when doing text file editing and want to do interrupt editing to do other things.  When done, can return (switch) to the editor and do the text file editing again.  Job works on foreground or background.  In foreground only for one job at a time.  Job on the foreground will control the shell - receive input from the keyboard and send output to the screen.  The job in the background does not accept input from the terminal, usually running without requiring interaction.
  • 10. https://github.com/syaifulahdan/os­practice|Operating System Practice |10 to 45   Job on the foreground may be suspended, with press [Ctrl- Z].  A paused job can be re-run in the foreground or background as needed by pressing "fg" or "bg".  For the record, stopping a temporary job is very different from doing an interrupt job (usually using [Ctrl-C]), where the interrupted job will be permanently disabled and can not be executed again.
  • 11. https://github.com/syaifulahdan/os­practice|Operating System Practice |11 to 45  5. Control Other Process  The ps command can be used to indicate all running processes on the machine (not just processes in the current shell) with the format : ps –fae or ps ­aux  Some versions of UNIX have a so-called top system utility that provides an interactive way to monitor system activity.  Statistics in detail with running processes are displayed and continually refreshed. The process is displayed in sequence from the CPU utility. A useful key on the top is
  • 12. https://github.com/syaifulahdan/os­practice|Operating System Practice |12 to 45  s – set update frequency u – display proses dari satu user k – kill proses (dengan PID) q – quit The utility for performing process controls can be found on UNIX systems is the killall command. This command will stop the process according to PID or job number process.
  • 14. https://github.com/syaifulahdan/os­practice|Operating System Practice |14 to 45  1 Login as user. 2 Download the C ++ program to display primes named primes. 3 Conduct the experiments below and then analyze the experimental results. 4 Complete the practice questions.
  • 16. https://github.com/syaifulahdan/os­practice|Operating System Practice |16 to 45  $ ps Experiment 1 : Process Status 1. Move to the command line terminal (tty2) by pressing Ctrl + Alt + F2 and login to terminal as user. 2. The ps (process status) instruction is used to view the process conditions. PID is the Process Identity Number, TTY is the terminal name where the process is active, STAT contains S (Sleeping) and R (Running), COMMAND is the instruction used.
  • 17. https://github.com/syaifulahdan/os­practice|Operating System Practice |17 to 45  $ ps -u 3. To see other factors / elements, use the -u (user) option. %CPU is the CPU time presentation used by the process, %MEM is the memory system presentation used by the process, SIZE is the sum memory used, RSS (Real System Storage) is the amount of memory used, START is when the process is enabled... 4. Looking for user-specific processes. The above process is only limited to the user process, where the user is logged in. $ ps -u $ ps –u <user>
  • 18. https://github.com/syaifulahdan/os­practice|Operating System Practice |18 to 45  5. Looking for other processes use the a (all) and au (all user) options 6. Logout and press Alt + F7 to return to graphics mode $ ps –a $ ps –au
  • 19. https://github.com/syaifulahdan/os­practice|Operating System Practice |19 to 45  Experiment 2 : Displays the Parent and Child Process Relationships 1. Move to command line terminal (tty2) by pressing Ctrl + Alt + F2 and login to terminal as user. 2. Type ps -eH and press Enter. Option e selects all processes and options H produce a hierarchical process view. The child process appears below parent rocess. The child process is marked by multiple spaces. $ ps ­eH
  • 20. https://github.com/syaifulahdan/os­practice|Operating System Practice |20 to 45  $ ps –e f 3. Type ps -e f and press Enter. The view is similar to step 2. The -f option will display the status of the process with graphic characters ( and _ ) 4. Type pstree and press Enter. Will show all processes on the system in the form of parent / child hierarchy. Process the parent to the left of the child process. For example the init process as a parent (ancestor) of all processes on the system. Some child from init has a child. Login process has bash process as child. The bash process has a child startx process. The startx process has child xinit and so on. $ pstree
  • 21. https://github.com/syaifulahdan/os­practice|Operating System Practice |21 to 45  $ pstree | grep mingetty 5. Type pstree | grep mingetty and press Enter. Will show all the mingetty process that runs on the system in the form of virtual console. In addition to displaying all processes, the process is grouped in a row with a number as the number of running processes. 6. To view all PIDs for the process use the ­p option. $ pstree –p 7. To show the process and ancestor in bold use option ­h. $ pstree –h
  • 22. https://github.com/syaifulahdan/os­practice|Operating System Practice |22 to 45  $ ps -e | more Experiment 3 : Displays the Status of Processes with Different Formats 1. Move to command line terminal (tty2) by pressing Ctrl + Alt + F2 and login to terminal as user. 2. Type ps -e | more and press Enter. The -e option displays all processes in the form of 4 columns: PID, TTY, TIME and CMD. If the full page shows a prompt --More-- at the bottom of the screen, press q to return to the command prompt....
  • 23. https://github.com/syaifulahdan/os­practice|Operating System Practice |23 to 45  3. Type ps ax | more and press Enter. Option a will show all processes the resulting terminal (TTY). The x option displays all processes the terminal does not generate. Logically this option is the same as the -e option. There are 5 columns: PID, TTY, STAT, TIME and COMMAND. $ ps ax | more If the full page shows a prompt --More-- at the bottom of the screen, press q to return to the command prompt....
  • 24. https://github.com/syaifulahdan/os­practice|Operating System Practice |24 to 45  4. Type ps -e f | more and press Enter. The -e f option will display all processes in full list format. $ ps ef | more If the full page shows a prompt --More-- at the bottom of the screen, press q to return to the command prompt.... 5. Type ps -eo pid, cmd | more and press Enter. The -eo option will display all processes in the format according to the user definition that consists of PID and CMD columns. $ ps –eo pid,cmd | more
  • 25. https://github.com/syaifulahdan/os­practice|Operating System Practice |25 to 45  If the full page shows a prompt --More-- at the bottom of the screen, press q to return to the command prompt.... 6. Type ps -eo pid, ppid,% mem, cmd | more and press Enter. Will display PID, PPID and% MEM columns. PPID is the process ID of the parent process. % MEM displays the percentage of memory system used by the process. If the process uses only a small amount of memory the system will get 0. $ ps –eo pid,ppid,%mem,cmd | more 7. Logout and press Alt + F7 to return to graphics mode
  • 26. https://github.com/syaifulahdan/os­practice|Operating System Practice |26 to 45  $ yes Experiment 4 : Control the process on the shell. 1. Move to command line terminal (tty2) by pressing Ctrl + Alt + F2 and login to terminal as user 2. Use the yes command that sends output y that never stops To stop it use Ctrl-C.
  • 27. https://github.com/syaifulahdan/os­practice|Operating System Practice |27 to 45  3. Turn standard output to /dev /null. $ yes > /dev/null If the full page shows a prompt --More-- at the bottom of the screen, press q to return to the command prompt.... To stop it use Ctrl-C. 4. One way to keep the yes command running but the shell is still used for something else by putting the process in the background by adding characters & at the end of the command $ yes > /dev/null & The number in "[ ]" is a job number followed by PID.
  • 28. https://github.com/syaifulahdan/os­practice|Operating System Practice |28 to 45  5. To view the status of the process use the jobs command. $ jobs 6. To stop a job, use the kill command followed by the job number or PID process. To identify job number, followed by prefix with character "%". $ kill %<nomor job> contoh: kill %1 7. View job status after termination $ jobs
  • 30. https://github.com/syaifulahdan/os­practice|Operating System Practice |30 to 45   Exercise : Practice 4A 1 Try the following command:    $ ps  $ ps ­u  $ ps ­u <user>  $ ps au  $ ps ­eH  $ ps ­e f  $ pstree  $ ps ­e | more  $ ps ax | more  $ ps ­ef | more  $ jobs  $ kill %<jobs number>  
  • 31. https://github.com/syaifulahdan/os­practice|Operating System Practice |31 to 45   Practice Report : Practice 4A 1 Analyze your experimental results. 2 Analyze the exercises that have been done. 3 Give a conclusion from this lab. Command Descripton ps ps ­u ps ­u <user> ps ­eH pstree jobs kill %<jobs number>
  • 32. https://github.com/syaifulahdan/os­practice|Operating System Practice |32 to 45   “Pleasure in a job makes perfection on the results  achieved”. Aristoteles  “Believe you can. You're halfway”. Theodore Roosevelt  “You might be able to delay, but time will not wait”.  Benjamin Franklin   “The effort will work if someone does not give up”.  Napoleon Hill  “Opportunity to find a better strength in us arises  when life seems to be very challenging”. Joseph  Campbell