Question
Not great in UNIX. Hint: Commands to study to answer this question: grep, wc, echo, pipe ( | ), ps, process states, and man pages
Not great in UNIX.
Hint: Commands to study to answer this question: grep, wc, echo, pipe ( | ), ps, process states, and man pages for ps options
NOTE: Use man command before you start answering this question and before issuing script command to find the options to use with the ps command to find the answers in this question as well as to find the characters representing the various states of a process.
1) Issue appropriate command to display your processes, that is, processes for which you are the owner
2) Display information about your processes using long option
3) Examine the output of the previous command and with echo command, display the name (command name) and the state character for your shell process and the meaning of the state character. You have to look at the man pages for the ps command to see the meaning of the process state character before doing this question when the script is not in effect. Never issue man command when script command is in effect.
4) Using echo command, answer the process id (pid) of the shell process and the parent pid of your shell process
5) Display all the processes in the system using an appropriate option other than long option
Pipe takes the standard output of the command preceding it and feeds to standard input of the command following it. The pipe is indicated by | character between the commands as
Command1 | Command2
The grep command can be used to search for a string in one or more files. When the line with the string is found, it is displayed.
The wc command can be used to find the number of lines, number of words and number of character in a file or the input supplied to it.
Using grep and pipe do the following:
6) Issue appropriate command to display all the processes in the system and pipe the output to the grep command to display the line containing the init process.
7) Using the echo command answer the process ID (pid) of the init process.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started