I/O Redirection and Pipe 1.1. Verify that stdout is mapped to your monitor. (Hint usels -aFcommand.) 1.2.
Question:
I/O Redirection and Pipe
1.1. Verify that stdout is mapped to your monitor. (Hint usels -aFcommand.)
1.2. . Redirectstdout to a file and observe that nothing is displayed on your monitor.
1.3. Verify that the contents of the file thus created is the same as what would've been
displayed on your monitor.
1.4. Append one more line ("Hello world") to the file and observe that its size is
increased.
1.5. . Recreate the same output file using a single>.
1.6. . Verify its size and its contents.
1.7. Display the largest 10 directories in your system. Sort the output command in
descending order and pipe it tohead to display the first 10 lines.
2. Parent-Child Relationship
2.1. 01pts. LHS : Display processes started by the logged in user (you) and attached to a
terminal.
2.2. 01pts. LHS : Display all processes attached to a terminal including those started by other
users.
2.3. 01pts. RHS : Display parent-child processes usingpstreecommand..
2.4. 01pts. RHS : Display parent-child processes usingpscommand.
2.5. 01pts. LHS : Display process listing in job format to include PPID.
2.6. 02pts. Identify the parent and child processes oftmuxyou're currently using. You can type
your answer in a new text file or use a comment line in CLI.
3. 25pts. Foreground and background processes.
3.1. 03pts. LHS : Start a long running process in foreground, then suspend and send it to
background.
3.2. 02pts. RHS : Display all processes attached to a terminal along with those started by user
u300*. Use command substitution. (Hint: usepscommand within$(...) )
3.3. 03pts. LHS : Start another long running process in foreground and suspend it from another
terminal (RHS). Note how only those processes that contain the patternsleepin their
command line are selected.
3.4. 02pts. LHS : When you reclaim your stdin and stdout on the LHS, runjobscommand to
display background jobs that are attached to your terminal.
3.5. 02pts. LHS : Start a long running job directly in background and notice the status of all jobs
in background, particularly the one with the ampersand.
3.6. 02pts. Resume processing of a suspended job. Note that you can resume a non-interactive
process only. Display your jobs in background.
3.7. 02pts. RHS : Suspend the job that was started in background.
3.8. 02pts. RHS : Display your jobs. Notice that no jobs are displayed, why ?
3.9. 04pts. RHS : Terminate the two sleep processes. Observe that the suspended one terminates
as soon as it is brought to foreground.
3.10. 03pts. RHS : Terminate the suspended interactive process. Also observe that it terminates
only when it is brought to foreground.