This set of Linux / Unix interview questions and answers focuses on Bash Shell programming & administration. It will be useful for both fresher & experienced preparing interviews on Unix Basics, Essentials and Shell programming.
1. The $ variables in a shell script context designates
a) The runtime of the script
b) Number of command line arguments
c) PID of the shell running the script
d) The exit status of the shell script
View Answer
Explanation: None.
2. Which variable is used to display number of arguments specified in command line
a) $0
b) $#
c) $*
d) $?
View Answer
Explanation: None.
3. Which variable contains last background job process id
a) $*
b) $?
c) $$
d) $!
View Answer
Explanation: None.
4. Which command can be used to test various file attributes
a) if
b) file
c) test
d) type
View Answer
Explanation: None.
5. * Specifies
a) one or more character
b) zero or more charecter
c) nothing
d) none of the mentioned
View Answer
Explanation: None.
6. ? Specifies
a) one or more character
b) zero or more charecter
c) one character
d) none of the mentioned
View Answer
Explanation: None.
7. Which of the following file set in the current directory are identified by the regular expression a?b*
a) afcc, aabb
b) aabb, axbc
c) abbb, abxy
d) abcd, axbb
View Answer
Explanation: None.
8. What command would send the output of cmd1 to the input of cmd2?
a) cmd1 | cmd2
b) cmd1 || cmd2
c) cmd1 && cmd2
d) cmd1 ; cmd2
View Answer
Explanation: None.
9. What is the output of the following command for bash shell:
echo linux $0
a) linux echo
b) linux linux
c) linux bash
d) linux
View Answer
Explanation: None.
10. Which variable will display the list of the positional parameters?
a) $#
b) $*
c) $?
d) $$
View Answer
Explanation: None.
Sanfoundry Global Education & Learning Series – Linux Administration & Programming.
Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best 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.
- Buy Linux Books
- Apply for Programming Internship
- Buy Information Technology Books
- Practice Programming MCQs
- Apply for Linux Internship