CFL Assessment 1
CFL Assessment 1
Assessment 1
Exercise 1 : Starting from the root directory, use the appropriate Linux shell commands to complete the
following tasks:
1. Change your current directory to the Desktop.
10. Open "sample.c" using the nano text editor without closing the terminal window.
13. List all files and directories on the Desktop along with their detailed properties, including
1- The parent process prints its ID, its child's ID, and the message "Parent process is executing!".
2- The child process prints its ID, its parent's ID, the message "Child process is starting...", exits immediately,
and the parent process waits for it to finish and prints "Parent process finished".
The libraries you need to include are: stdio.h, stdlib.h, unistd.h, sys/wait.h
A sample run:
Parent:
myid = 3000
my child's id = 3001
Parent process is executing!
(child exits immediately)
Child:
myid = 3001
my parent's id = 2576
Child process is starting...
Child process finished