Explore topic-wise MCQs in Unix.

This section includes 358 Mcqs, each offering curated multiple-choice questions to sharpen your Unix knowledge and support exam preparation. Choose a topic below to get started.

201.

Which command is used to for executing jobs according to their priority?

A. nohup
B. $
C. &
D. nice
Answer» E.
202.

When nohup command is used, shells returns the ___

A. PID
B. PPID
C. tty
D. TTy
Answer» B. PPID
203.

Shell ___ operator is used for running jobs in the background.

A. $
B. #
C. |
D. &
Answer» E.
204.

Which system call is used by the parent process to wait for the child process to complete?

A. wait
B. exec
C. fork
D. exit
Answer» C. fork
205.

Which of the following system call is used for creating a new process?

A. read
B. fork
C. wait
D. new
Answer» C. wait
206.

There are ___ distinct phases of a process.

A. 2
B. 5
C. 4
D. 3
Answer» E.
207.

Which of the following command doesn’t create a process?

A. pwd
B. fork
C. cd
D. pwd and cd
Answer» E.
208.

To know the PID of your current shell, which command will be used?

A. echo $$
B. echo $
C. $SHELL
D. $PATH
Answer» B. echo $
209.

Which process is immediately set up by the kernel when we log on to a UNIX system?

A. shell
B. parent
C. shell
D. bash
Answer» B. parent
210.

Each process is identified by a unique integer called _

A. PID
B. PPID
C. TID
D. PTID
Answer» B. PPID
211.

The parent id of a child is called ____

A. PID
B. PPID
C. TID
D. PTID
Answer» C. TID
212.

When the process has completed its execution it is called _____

A. born
B. terminated
C. waiting
D. exit
Answer» E.
213.

Some attributes of every process are maintained by the kernel in memory in a separate structure called the ___

A. pcb
B. task control block
C. process table
D. task table
Answer» D. task table
214.

Command substitution requires the command to use _____

A. standard input
B. standard output
C. standard error
D. all of the above
Answer» C. standard error
215.

C shell uses which command for assigning values to variables?

A. =
B. set
C. unset
D. $
Answer» C. unset
216.

A variable can be removed using ___

A. unset
B. readonly
C. del
D. bash
Answer» B. readonly
217.

Which of the following shell doesn’t support the command substitution using $ recommended by POSIX?

A. Korn
B. bash
C. C
D. bourne
Answer» E.
218.

POSIX recommends the use of ____ instead of archaic `command ` for command substitution.

A. |
B. #
C. %
D. $
Answer» E.
219.

Shell enables one or more arguments to be obtained from the standard output of another command. This feature is called _______

A. command substitution
B. argument substitution
C. shell substitution
D. korn
Answer» B. argument substitution
220.

Which of the following is not true about tee command?

A. it is a feature of the shell
B. it is an external command
C. tee command duplicates its input
D. tee is an internal command
Answer» B. it is an external command
221.

Which command saves one copy of character stream in a file and store the other to standard output?

A. who
B. ls
C. tee
D. wc
Answer» D. wc
222.

Which symbol is used to connect different streams?

A. |
B. >
C. <
D. ~
Answer» B. >
223.

Which file is used for indicating terminals?

A. /dev/tty
B. /dev/null
C. terminal file
D. device file
Answer» B. /dev/null
224.

Which of the following files are known as special files in UNIX?

A. sample.txt
B. /dev/null
C. /dev/tty
D. /dev/null and /dev/tty
Answer» E.
225.

Which symbol is used to redirect error messages to /dev/null?

A. %
B. $
C. >
D. <
Answer» D. <
226.

We can redirect the error message to file named newfile using __________ command.

A. cat foo errorfile
B. cat foo >errorfile
C. cat errorfile>foo
D. cat foo 2>errorfile
Answer» E.
227.

The category of commands which uses both standard input and standard output are called ____

A. directory oriented commands
B. standard input commands
C. filters
D. standard output commands
Answer» D. standard output commands
228.

Which file descriptor is used to represent standard error stream?

A. 0
B. 1
C. 2
D. 3
Answer» D. 3
229.

Which symbol is used for taking input from both file and standard input?

A. &
B. %
C. -
D. $
Answer» D. $
230.

How many files are used for representing different streams?

A. 1
B. 2
C. 4
D. 3
Answer» E.
231.

Which of the following command will remove the file named * ?

A. rm *
B. rm ‘*’
C. rm \*
D. rm ‘*’ and rm \*
Answer» E.
232.

For escaping the newline character we can use ___

A. /
B. \
C. ?
D. \n
Answer» C. ?
233.

Which of the following shell doesn’t support ! symbol for negating the character class?

A. bash
B. bash
C. POSIX
D. C
Answer» E.
234.

Providing a backslash (\) before the wild card to remove its special meaning is called _____

A. escaping
B. quoting
C. listing
D. pattern matching
Answer» B. quoting
235.

Which of the following symbol is used for negating the character class?

A. .
B. *
C. !
D. %
Answer» D. %
236.

Which of the following files will not be deleted using “rm chap??” ?

A. chap01
B. chap02
C. chaptd
D. chactd
Answer» E.
237.

* and ? cannot match ___

A. /
B. $
C. .
D. / and .
Answer» E.
238.

Which of the following command will list all the hidden filenames in our directory having at least three characters after the dot (.) ?

A. ls
B. ls -a
C. ls .???*
D. ls *
Answer» D. ls *
239.

Which command would be most suitable to remove the following files? dirx diry dirz dirzw

A. rm dir?
B. rm dirx diry dirz dirzw
C. rm *
D. rm dir*
Answer» B. rm dirx diry dirz dirzw
240.

What does the following command do? $ echo *

A. error
B. undefined behaviou
C. displays “*”
D. lists all filenames in the current directory
Answer» E.
241.

Which of the following expression is a correct wildcard pattern if we want an expression in which the last character is not numeric?

A. *[!0]
B. *[0-9]
C. [0-9]
D. *[!0-9]
Answer» E.
242.

In Shell’s interpretive cycle, the shell first scans for ____ in the entered command.

A. characters
B. priority
C. meta-characters
D. wildcards
Answer» D. wildcards
243.

Which shell is the most common and best to use?

A. Korn shell
B. POSIX shell
C. C shell
D. Bash shell
Answer» E.
244.

Which command does not terminates unless we log out of the system?

A. history
B. shell
C. echo
D. login
Answer» C. echo
245.

The prompt issued by the shell is called ___

A. prompt
B. command translator
C. command prompt
D. command executor
Answer» D. command executor
246.

On a UNIX system, there can be ____ shells running simultaneously .

A. 1
B. 2
C. many
D. 4
Answer» D. 4
247.

Which of the following flag will be used for interactive substitution?

A. g
B. G
C. gc
D. cg
Answer» D. cg
248.

Which of the following commands can be used to replace ‘professor’ with ‘director’ throughout the whole file?

A. 1,$s/professor/director/g
B. %s/professor/director/g
C. 1,$s/professor/director
D. 1,$s/professor/director/g and %s/professor/director/g
Answer» E.
249.

Which one of the following commands will be used to delete all the instances of string ‘manager’ in file003?

A. 1,$s/manager/ /g
B. %s/manager/director/g
C. 1,$s/professor/director
D. %s/manager/ /
Answer» B. %s/manager/director/g
250.

___ searches for a first instance of a pattern in the backward direction.

A. /
B. %
C. &
D. ?
Answer» E.