CSC506 Exercise 3
Chapter 3 Processes
(30 pts)
Create a document named ex3-XXXXX where XXXXX is your student ID using a text editor, MS Word, or PDF format that can be read on Windows PC.
Use your Ubuntu VM from the previous exercise.
1- (5 pts) Write the commands to display with details only the processes located in /usr/bin directory that are running.
(Hint: use a pipe and grep)
Capture the screenshot and insert in answer here
2- (5 pts) Write the 3 Linux commands and execute them in a pipe (one single line) to
-get the content of the file /etc/sysctl.conf
-search only for the lines that contains the word “net”
-sort the lines in alphabetical order
Capture a screenshot of the commands and results on your Ubuntu VM and insert here
3- (8 pts) Using Named pipe
a-Write the command to create a named pipe “mypipe_xxxxx” where xxxxx is your student ID.
b-Use the ls command to list the named pipe with its size.
Capture a screenshot of the commands and result on your Ubuntu VM and insert here
c-Then list all files in the directory /etc and redirect the output text to the named pipe.
d-While the above command is running, open a second Linux terminal and show the content of the named pipe. You should see the same content that was sent to the pipe in the previous step.
Capture a screenshot of the commands and result on your Ubuntu VM and insert here
4- (3 pts) Explain what this C code do:
5- (3 pts) Explain what this C code do:
6- (6 pts) Read this code and explain what it does (in 3 or 4 sentences)