Linux Bash Shell Questions and Answers on Command History and Job Control for Freshers

1. fc stands for

a) find command
b) fix command
c) both find & fix command
d) none of the mentioned
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) !$
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.
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
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
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
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

Explanation: 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

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

Related

Data Structures Multiple Choice Questions and Answers on Adjacency List

1. Space complexity for an adjacency list of an undirected graph having large values of V (vertices) and E (edges) is ___________ a) O(E)b) O(V*V)c) O(E+V)d) O(V) Answer: c Explanation: In an adj...

Data Structures Multiple Choice Questions and Answers on Incidence Matrix and Graph Structured Stack

1. Incidence matrix and Adjacency matrix of a graph will always have same dimensions? a) Trueb) False Answer: b Explanation: For a graph having V vertices and E edges, Adjacency matrix have V*V e...

Data Structures Multiple Choice Questions and Answers on Adjacency Matrix

1. The number of elements in the adjacency matrix of a graph having 7 vertices is __________ a) 7b) 14c) 36d) 49 Answer: d Explanation: There are n*n elements in the adjacency matrix of a graph w...

Post a Comment

emo-but-icon
:noprob:
:smile:
:shy:
:trope:
:sneered:
:happy:
:escort:
:rapt:
:love:
:heart:
:angry:
:hate:
:sad:
:sigh:
:disappointed:
:cry:
:fear:
:surprise:
:unbelieve:
:shit:
:like:
:dislike:
:clap:
:cuff:
:fist:
:ok:
:file:
:link:
:place:
:contact:

item