250+ TOP MCQs on Command History and Job Control and Answers

Linux / Unix questions and answers focuses on Command History and Job Control in Bash Shell programming1. fc stands for
a) find command
b) fix command
c) both find & fix command
d) none of the mentioned

Answer: c
Clarification:’fc -l’ is used to list history of commands and ‘fc -e’ to edit them and ‘history’ command also provides the histroy of commands.

2. Which command is used to reexecute the previous command?
a) !!
b) !cat
c) !3
d) !$

Answer: a
Clarification:’!cat’ will reexecute the last cat command, ‘!3’ will reexecute the third last command and ‘!$’ will execute the last argument of previous command.

3. Which one of the following is not correct about job control in bash shell?
a) it is the ability to stop and resume any process running in shell at a later point
b) user employs this facility via an interactive interface supplied by the kernel’s terminal driver and bash
c) it is the ability to create any process
d) none of the mentioned

Answer: c
Clarification: None.

4. Which command allows to view the current jobs being handled by the shell?
a) jobs
b) view
c) show
d) none of the mentioned

Answer: a
Clarification: None.

5. What is job number?
a) same as PID
b) a unique number, assigned to each job in shell
c) same as PID and a unique number, assigned to each job in shell
d) none of the mentioned

Answer: b
Clarification: None.

6. Ctrl-Z key combination
a) generates a SIGINT signal
b) stops the process running in the shell
c) kills the process running in the shell
d) generates a SIGINT signal & kills the process running in the shell

Answer: b
Clarification: Ctrl-Z key combination generates a SIGTSTP signal and stops the process running in the shell.

7. Which command brings a background job into the foreground?
a) fg
b) bg
c) jobs %1
d) none of the mentioned

Answer: a
Clarification: bg command brings a foreground job into the background.

8. ‘kill %s’ command will
a) terminate the job whose command line starts with s
b) terminate the last job
c) terminate the first job
d) none of the mentioned

Answer: a
Clarification: None.

9. ‘stty tostop’ command will
a) stop all jobs running in the shell
b) stop background jobs if they try to send output to the terminal
c) this is not a valid command
d) none of the mentioned

Answer: b
Clarification: None.

10. Which command terminates a running process by name of the process?
a) kill
b) pkill
c) killall
d) none of the mentioned

Answer: c

Leave a Reply

Your email address will not be published. Required fields are marked *