Unix Shell Scripting MCQs
Shell Scripting MCQs : This section focuses on "Basics" of Shell Progamming in Unix. These Multiple Choice Questions (MCQ) should be practiced to improve the unix skills required for various interviews (campus interviews, walk-in interviews, company interviews), placements, entrance exams and other competitive examinations.
1. Which of the following is not a type of shell?
A. The C Shell
B. The Korn Shell
C. The Bourne Shell
D. The Perl Shell
View Answer
Ans : D
Explanation: The Perl shell is not a type of shell in unix.
2. Which of the following is true about shell?
A. A Shell provides you with an interface to the Unix system.
B. Shell gathers input from you and executes programs based on that input.
C. Shell is an environment in which we can run our commands, programs, and shell scripts.
D. All of the above
View Answer
Ans : D
Explanation: All of the above statement are true about shell.
3. What will be the output of $date?
A. Yesterday date
B. Current date
C. Current date and time
D. Tomarrow date and time
View Answer
Ans : C
Explanation: The date command which displays the current date and time.
4. The original Unix shell was written in the mid ________.
A. 1960s
B. 1970s
C. 1980s
D. 1990s
View Answer
Ans : B
Explanation: The original Unix shell was written in the mid-1970s.
5. The original Unix shell was written by __________.
A. Stephen R. Bourne
B. Stephen R. Korn
C. Stephen R. C.
D. Stephen Watson
View Answer
Ans : A
Explanation: The original Unix shell was written in the mid-1970s by Stephen R. Bourne
6. On a UNIX system, there can be ____ shells running simultaneously.
A. 2
B. 3
C. 4
D. Many
View Answer
Ans : D
Explanation: On a UNIX system, there can be many shells running simultaneously.
7. The prompt issued by the shell is called ______
A. prompt
B. command translator
C. command prompt
D. command executor
View Answer
Ans : C
Explanation: The prompt issued by the shell is called a command prompt which is represented by $.
8. In UNIX there are ___ major types of shells.
A. 2
B. 3
C. 4
D. 5
View Answer
Ans : A
Explanation: In UNIX, there are two major types of shells : Bourne shell and C shell.
9. What is the default symbol for command prompt in Bourne shell?
A. !
B. #
C. $
D. @
View Answer
Ans : C
Explanation: If we are using bourne shell on our system, then the default prompt will be represented by $.
10. Which shell is the most common and best to use?
A. Korn shell
B. C shell
C. Bourne shell
D. Bash Shell
View Answer
Ans : D
Explanation: Bash is near POSIX-compliant and probably the best shell to use.
Discussion