GOVERNMENT POLYTECHNIC, AMBAD.
DEPARTMENT OF COMPUTER ENGINEERING
COURSE & CODE-OPERATING SYSTEM-22516
ACADEMIC YEAR- 2023-24
A MICRO-PROJECT ON
“Process Commands in Linux”
FOR THE AWARD OF
DIPLOMA IN ENGINEERING & TECHNOLOGY
( Computer Engineering – CO- 5I )
UNDER THE GUIDANCE OF
[Link]
SUBMITTED BY
Sr NO Roll No Enrollment No Name of Student
1 317 2111620092 Kakde Chaitany Sandip
1
GOVERNMENT POLYTECHNIC, AMBAD.
DEPARTMENT OF COMPUTER ENGINEERING
COURSE & CODE-OPERATING SYSTEM-22516
CERTIFICATE
This is to certify that the Micro-project entitled “PROCESS COMMANDS IN LINUX”
being submitted here with for the award of DIPLOMA IN ENGINEERING &
TECHNOLOGY in COMPUTER ENGINEERING of MAHARASHTRA STATE
BOARD & TECHNICAL EDUCATION (MSBTE) is the result of Micro-project
work completed by Roll no 317 under the supervision and guidance of [Link]
It is to the best of my knowledge and belief that the work embodied in this Micro-project
has not formed earlier the basis for the award of any degree or diploma of this or any other
Board or examining body.
Academic Year: 2023-24. Semester : FIFTH Enrollment No:2111620092
Place: Ambad
Date:
[Link] [Link] Dr. [Link]
Micro-project Guide H.O.D CO Principal, Government Polytechnic,Ambad
2
DECLARATION
I, the under signed hereby declare that the project entitled “PROCESS
COMMANDS IN LINUX” is written and submitted by Group A to Government
Polytechnic Ambad during Year 2023-24, Second Semester for partial
fulfillment of the ‘Micro Project’ requirement of ‘OPERATING SYSTEM’
course under Maharashtra State Board of Technical Education, Mumbai
curriculum, under the guidance of Mr. [Link] is my original work. The
empirical findings in this project are based on the collected data and are not
copied from any other sources.
Sr NO Roll Enrollment No Name of Student Signature
No
1 317 2111620092 Kakde Chaitany Sandip
3
ACKNOWLEDGEMENTS
I have great pleasure to express my immense gratitude towards a dynamic person
and my project guide [Link] Department of COMPUTER ENGINEERING
Government Polytechnic, Amad for giving me an opportunity to work on an interesting
topic over one semester. The work presented here could not have been accomplished
without her most competent and inspiring guidance, incessant encouragement,
constructive criticism and constant motivation during all phases of our group Micro-
project work. I am highly indebted to him.
I am very much thankful to [Link], Head Department of COMPUTER
ENGINEERING ,all HODs of various departments as [Link] Sir, The
Principal of Government Polytechnic, Ambad for his encouragement and providing me a
motivating environment and project facilities in the Institute to carry out experiments and
complete this Micro-project work.
I would like to extend my thanks to all our professors, staff members and all our friends
who extended their co-operation to complete the project.I am indeed indebted to my
parents and other family members for their immense help at all levels with moral, social &
financial support, care and support throughout my studies without which my work would
not have seen light of the day with warm regards,
Yours Sincerely,
Place: Ambad -------------------------------------------
Date:
4
GOVERNMENT POLYTECHNIC, AMBAD.
DEPARTMENT OF COMPUTER ENGINEERING
COURSE & CODE- OPERATING SYSTEM /22516
ACADEMIC YEAR- 2023-24
A MICRO-PROJECT ON
“Process Commands in Linux”
(COMPUTER ENGINEERING CO- 5I)
INDEX
Sr.n Title Page No .
o
1. Introduction 6
2. Different Type’s of Process 7
Command’s
3. Commands:Use,Syntax,Output 8 - 18
4. Conclusion & REFERENCE 19
5
Introduction
In the world of Linux and Unix-based operating systems, the command line
interface (CLI) is a powerful tool for managing and interacting with the system.
Among the multitude of commands available, those related to process
management play a crucial role in controlling and monitoring the execution of
programs and tasks. These commands are essential for system administrators,
developers, and power users alike.
Process commands in Linux are a set of tools and utilities designed to handle,
track, and manipulate processes that are running on a system. A process, in this
context, represents a running instance of a program or application. These
commands provide users with the ability to perform various tasks, such as
starting new processes, terminating existing ones, prioritizing processes,
monitoring system performance, and more.
Commonly used process commands include 'ps' (process status), which displays
information about active processes; 'top' and 'htop,' which provide real-time
system and process monitoring; 'kill,' which is used to terminate processes;
'nice' and 'renice,' which adjust process priorities; 'pgrep' and 'pkill,' which
search for and kill processes based on specific criteria; and 'jobs,' which is used
in shell sessions to manage background processes.
6
Linux Architecture
Different Types of Process Commands:
ps: Display information about active processes.
top: Provide real-time system and process monitoring.
htop: An interactive process viewer and system monitor.
kill: Terminate a process using its process ID (PID).
killall: Terminate processes by name.
pkill: Signal processes based on their name or other attributes.
pgrep: List PIDs of processes matching specified criteria.
nice: Set the priority of a process.
renice: Change the priority of a running process.
jobs: Manage background jobs in a shell session.
fg: Bring a background process to the foreground.
bg: Send a process to the background.
ps aux: Show detailed information about all processes.
wait: A command used to wait for the completion of
background processes before continuing with other tasks in a
script or command sequence.
7
sleep: A command to introduce a specified delay or pause in
the execution of a script or command, allowing for time-based
synchronization or timing purposes.
exit: A command that terminates a script or shell session,
returning an exit status code to indicate the success or failure
of the last executed command.
Commands:Use,Syntax,Output:
[Link]:
Use: Display information about active processes.
Syntax: ps [OPTIONS]
Output: Lists active processes with various details.
Output: Lists active processes with various details.
chaitany@linux:~$ ps
PID TTY TIME CMD
1234 pts/0 0:00 bash
5678 pts/0 0:10 myapp
[Link]:
Use: Provide real-time system and process monitoring.
Syntax: top
Output: Displays dynamic system statistics and a list of running processes.
chaitany@linux:~$ top
top - [Link] up 1 day, 2 users, load average: 0.12, 0.08, 0.04
Tasks: 104 total, 2 running, 102 sleeping, 0 stopped, 0 zombie
8
%Cpu(s): 1.2 us, 0.2 sy, 0.0 ni, 98.6 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0
st
KiB Mem : 2046936 total, 125432 free, 951712 used, 971792
buff/cache
KiB Swap: 2097148 total, 2056892 free, 40256 used. 1020508 avail
Mem
[Link]:
Use: An interactive process viewer and system monitor.
Syntax: htop
Output: An interactive and more feature-rich alternative to 'top.'
chaitany@linux:~$ htop
(Interactive, real-time system and process monitor)
[Link]:
Use: Terminate a process using its process ID (PID).
Syntax: kill [PID]
Output: Sends a signal to stop the specified process.
chaitany@linux:~$ kill 5678
[Link]:
Use: Terminate processes by name.
Syntax: killall [PROCESS_NAME]
Output: Stops all processes with the specified name.
chaitany@linux:~$ killall myapp
[Link]:
Use: Signal processes based on their name or other attributes.
Syntax: pkill [OPTIONS] [PROCESS_NAME]
Output: Sends signals to processes that match the given criteria.
chaitany@linux:~$ pkill -f "process_name"
9
[Link]:
Use: List PIDs of processes matching specified criteria.
Syntax: pgrep [OPTIONS] [PROCESS_NAME]
Output: Lists the PIDs of processes that meet the specified criteria.
chaitany@linux:~$ pgrep process_name
1234
[Link]:
Use: Set the priority of a process.
Syntax: nice [OPTIONS] [COMMAND]
Output: Adjusts the priority of a process.
chaitany@linux:~$ nice -n 10 command
[Link]:
Use: Change the priority of a running process.
Syntax: renice [OPTIONS] [PID]
Output: Modifies the priority of a currently running process.
chaitany@linux:~$ renice -n 5 1234
[Link]:
Use: Manage background jobs in a shell session.
Syntax: jobs [OPTIONS]
Output: Lists the status of background jobs in the current shell session.
chaitany@linux:~$ jobs
[1]- Running [Link] &
[2]+ Stopped myapp
10
[Link]:
Use: Bring a background process to the foreground.
Syntax: fg [JOB_SPEC]
Output: Brings a background job to the foreground for interaction.
chaitany@linux:~$ fg %1
[Link]:
Use: Send a process to the background.
Syntax: bg [JOB_SPEC] Output: Resumes a stopped background job.
chaitany@linux:~$ bg %2
[Link] aux:
Use: Show detailed information about all processes.
Syntax: ps aux
Output: Provides extensive details about all running processes.
chaitany@linux:~$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME
COMMAND
chaitany 1234 0.1 0.2 12345 6789 pts/0 Ss+ 14:00 0:01 bash
chaitany 5678 2.5 3.4 123456 7890 pts/0 Sl+ 14:10 1:23 myapp
[Link]:
Use: Wait for the completion of background processes before continuing with
other tasks in a script or command sequence.
Syntax:$wait
Output:
chaitany@linux:~$ wait
[Link]:
11
Use: Introduce a specified delay or pause in the execution of a script or
command, allowing for time-based synchronization or timing purposes.
Syntax:$sleep PID
Output:
chaitany@linux:~$ sleep 5
[Link]:
Use: Terminate a script or shell session, returning an exit status code to indicate
the success or failure of the last executed command.
Syntax:$exit
Output:
chaitany@linux:~$ exit
CONCLUSION
In this discussion, we've explored a variety of essential Linux commands
related to process management, as well as some common system utility
commands. These commands are vital for monitoring and controlling
processes, adjusting process priorities, and managing background tasks.
Understanding how to use them effectively is crucial for system
administrators, developers, and power users to ensure the stability and
performance of a Linux-based system.
REFERENCES
Linux Manual Pages: You can access Linux manual pages directly from
your terminal using the man command. For example, to view the manual
for the ps command, you can use man ps.
Linux Documentation Project (TLDP): The official website of TLDP
provides a wealth of Linux documentation and how-to guides. You can
visit their website at [Link]
12
Linux Community Forums: Websites like [Link] and Ask
Ubuntu host active communities where you can ask questions and find
user-contributed guides.
13