0% found this document useful (0 votes)
19 views6 pages

Practical 5

Uploaded by

Vaibhav Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views6 pages

Practical 5

Uploaded by

Vaibhav Bhagat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

 Program Code:

1. What is the process id of your login shell?


 $ps -p$$ this command will display the process id of any login shell.
Output:

2. Give PID of all processes, how you will terminal the processes
running on your terminal.
 $ps -A: This command will help to terminal all the processes running
on in any terminal and will show the PID of all processes.
Output:
3. What is the difference between wait and sleep?

Sleep Wait
It is used to hold the It puts thread in waiting
process state and it won’t back
automatically
It doesn’t release the lock It releases the lock while
while waiting waiting
It is used to produce pause It is used for inter-thread
on execution communication
Calls on thread Calls on object
5. List the system calls for process management.
 Following are the System calls for process management along with its
Description
▪ fork() To create a new process
▪ exec() To execute a new program in a process
▪ wait() To wait until a created process completes its execution
▪ exit() To exit from a process execution
▪ getpid() To get a process identifier of the current process
▪ getppid() To get parent process identifier
▪ nice() To bias the existing priority of a process
▪ brk() To increase/decrease the data segment size of a process

 Exercise:
1. Observe the output of following commands?

a) $ echo$$
Output :-
b) $sleep 10;date
Output :-

2. Display a full listing of all the processes running on your terminal.


Command for listing all the processes running on the terminal :
$ps –A

Output:
 Conclusion:
Hence, I have successfully executed various process commands on my
personal Linux window.

You might also like