Linux Bash Shell Questions and Answers – Command History and Job Control

«
»
This set of Linux / Unix questions and answers focuses on Command History and Job Control in Bash Shell programming

1. fc stands for
a) find command
b) fix command
c) both find & fix command
d) none of the mentioned
View Answer

Answer: c
Explanation:’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) !$
View Answer

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

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
View Answer

Answer: c
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: 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
View Answer

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

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

Answer: a
Explanation: 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
View Answer

Answer: a
Explanation: 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
View Answer

Answer: b
Explanation: None.

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

Answer: c
Explanation: None.
advertisement

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.

Here’s the list of Best Reference Books in Linux Commands & Shell Programming.
Here’s the list of Best Reference Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

advertisement
advertisement
advertisement
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He is Linux Kernel Developer & SAN Architect and is passionate about competency developments in these areas. He lives in Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux Networking, Linux Storage, Advanced C Programming, SAN Storage Technologies, SCSI Internals & Storage Protocols such as iSCSI & Fiber Channel. Stay connected with him @ LinkedIn