Linux Questions & Answers – Shell Environment – 1

This set of Linux / Unix questions and answers focuses on Bash Shell environment. It will be useful for anyone learning Linux Basics, Essentials and Shell programming.

1. To feed standard output of one command to standard input of another in a single shell session
a) IO redirection can be used
b) Named pipes can be used
c) The pipe operator provided by the shell can be used
d) It can not be done
View Answer

Answer: c
Explanation: None.

2. Which of the following commands allows definition and assignment of environment variables under bash
a) env
b) export
c) environ
d) setenviron
View Answer

Answer: a
Explanation: None.

3. While executing a command, the shell
a) Executes it in the same process (as shell)
b) Creates a child shell to execute it
c) Loads a special program to take care of the execution
d) None of the mentioned
View Answer

Answer: b
Explanation: None.
advertisement
advertisement

4. Which variable contains current shell process id
a) $*
b) $?
c) $$
d) $!
View Answer

Answer: c
Explanation: None.

5. Which command is used to debug a shell script program
a) set
b) set -x
c) debug
d) db
View Answer

Answer: b
Explanation: None.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. For every successful login, which script will be executed?
a) /etc/inittab
b) /etc/profile
c) /etc/login
d) /etc/init
View Answer

Answer: b
Explanation: None.

7. Hidden files are
a) Those whose ‘read’ bit is set to ‘h’
b) Permitted for (can be accessed) only superusers
c) Files that begin with a ‘.’
d) Files that cannot be opened by ordinary user for writing
View Answer

Answer: c
Explanation: None.
advertisement

8. Shell is ?
a) Command Interpreter
b) Interface between Kernel and Hardware
c) Interface between user and applications
d) Command Compiler
View Answer

Answer: a
Explanation: None.

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

advertisement

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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
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 - Founder & CTO at Sanfoundry
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.