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

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

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

Answer: b
Explanation: None

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

Answer: c
Explanation: None.

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

Answer: b
Explanation: None.

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

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

Answer: c
Explanation: None.

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

Answer: a
Explanation: None.

Leave a Comment