Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

Linux Questions & Answers – Shell Special


Symbols
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

2. Which variable is used to display number of arguments specified in command line


a) $0
b) $#
c) $*
d) $?
View Answer

Answer: b
Explanation: None.

3. Which variable contains last background job process id


a) $*
b) $?
c) $$
d) $!
View Answer

Answer: d
Explanation: None.
Dick Smith

Crosshatch Mens Matharm Shorts (Pack Of 2) (Navy) (M)


advertisement

https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 1/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

4. Which command can be used to test various file attributes


a) if
b) file
c) test
d) type
View Answer

Answer: c
Explanation: None.

5. * Specifies
a) one or more character
b) zero or more charecter
c) nothing
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

6. ? Specifies
a) one or more character
b) zero or more charecter
c) one character
d) none of the mentioned
View Answer
https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 2/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

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

Answer: b
Explanation: None.

advertisement

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

Answer: a
Explanation: None.

9. What is the output of the following command for bash shell:


echo linux $0
a) linux echo
b) linux linux
https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 3/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

c) linux bash
d) linux
View Answer

Answer: c
Explanation: None.

advertisement

10. Which variable will display the list of the positional parameters?
a) $#
b) $*
c) $?
d) $$
View Answer

Answer: b
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.

« Prev - Linux Questions & Answers – Shell » Next - Linux Questions & Answers – Search
Redirection Pattern

https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 4/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

Related Posts:

Check Linux Books


Practice Programming MCQs
Check Information Technology Books
Apply for Linux Internship
Apply for Programming Internship

advertisement

Recommended Articles:
1. Linux Questions & Answers – Shell Environment – 1
2. Unix Questions and Answers – Shell Programming using read Command and Command Line
Arguments
3. Linux Questions & Answers – Shell Environment – 2
4. Linux Bash Shell Questions and Answers – Command History and Job Control
5. Linux Shell Programming Questions and Answers – Functions
6. Linux Bash Shell Questions & Answers – Built-in Commands – 1
7. Unix Questions and Answers – Shell Programming using Various Commands – 2
8. Linux Shell Programming Questions and Answers – Variables
9. Linux Questions & Answers – Shell Programming
10. Linux Bash Shell Questions & Answers – Built-in Commands – 2

https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 5/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

advertisement

Additional Resources:
Linux MCQ Questions
Linux Commands with Examples
Unix MCQ Questions
C Programs on File Handling
JavaScript MCQ Questions

Popular Pages:
Event Handling in Java with Examples
C Programming Examples
C Tutorial
C Programming MCQ Questions
Programming MCQ Questions

https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 6/7
1/31/24, 4:25 AM Unix Administration Interview Questions & Answers on Shell Programming - Sanfoundry

Subscribe: Linux Newsletter

Name

Email

Subscribe

Subscribe to our Newsletters (Subject-wise). 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!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest

Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is
Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on
development of Linux Kernel, SAN Technologies, Advanced C, Data
Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram


SanfoundryClasses.

About | Certifications | Internships | Jobs | Privacy Policy | Terms | Copyright | Contact

     

© 2011-2024 Sanfoundry. All Rights Reserved.

https://www.sanfoundry.com/unix-administration-interview-questions-shell/ 7/7

You might also like