UNIX MCQs

By: Prof. Fazal Rehman Shamil
Last modified on April 22nd, 2021

Solved UNIX MCQs on Redirection and Pipes in operating systems.

Taking input from standard input which of the following symbol is used?
(A). &
(B). %
(C). $
(D). –
(E). None of these
MCQ Answer: d


For representing error messages _____ stream is used?
(A). standard error
(B). standard output
(C). standard input
(D). error
(E). None of these
MCQ Answer: a


The /dev/tty is used as an argument to some commands apart from its use in redirection.
(A). True
(B). False
(E). None of these
MCQ Answer: a


Which of the following command saves one copy of the character stream in the file and stores the other to the standard output?
(A). tee
(B). ls
(C). who
(D). wc
(E). None of these
MCQ Answer: a


The____ stream is connected to display.
(A). standard output
(B). standard input
(C). standard error
(D). error
(E). None of these
MCQ Answer: a


To represent standard error stream we use _______ file descriptor
(A). 0
(B). 1
(C). 3
(D). 2
(E). None of these
MCQ Answer: d


_______command is used to redirect the error message to a file named newfile.
(A).cat foo 2>errorfile
(B). cat foo >errorfile
(C). cat errorfile>foo
(D). cat foo errorfile
(E). None of these
MCQ Answer: a


To represent different standard streams How many files are used?
(A). 1
(B). 2
(C). 3
(D). 4
(E). None of these
MCQ Answer: c


To overwrite the existing file if it exists we use >> symbol.
(A). True
(B). False
(E). None of these
MCQ Answer: b


To redirect the output to a file or another program, which symbol is used?
(A). |, > and >>
(B). >
(C). >>
(D). |
(E). None of these
MCQ Answer: a


The internal command is tee.
(A). True
(B). False
(E). None of these
MCQ Answer: b


Not true about tee command is_____
(A).tee is an internal command
(B). it is an external command
(C). tee command duplicates its input
(D). it is a feature of the shell
(E). None of these
MCQ Answer: d


In UNIX which files are called special files?
(A). sample.txt
(B). /dev/null and /dev/tty
(C). /dev/tty
(D). /dev/null
(E). None of these
MCQ Answer: b


The /dev/null size is always zero.
(A). False
(B). True
(E). None of these
MCQ Answer: b


To redirect the error messages to /dev/null which of the following symbol is used?
(A). >
(B). $
(C). %
(D). <
(E). None of these
MCQ Answer: a


What is the category of the commands called which uses both standard output and standard input?
(A). directory oriented commands
(B). standard input commands
(C). standard output commands
(D). filters
(E). None of these
MCQ Answer: d


From the file sample.txt the command wc < sample.txt counts the data.
(A). False
(B). True
(E). None of these
MCQ Answer: b


For switching of the standard stream of data, we use the redirection process.
(A). False
(B). True
(E). None of these
MCQ Answer: b


For the interpretive cycle of the shell, in the entered command the shell first scans for ___.
(A). meta-characters
(B). priority
(C). characters
(D). wildcards
(E). None of these
MCQ Answer: a


In the C shell for command prompt, the default symbol is____
(A). $
(B). @
(C). #
(D). %
(E). None of these
MCQ Answer: d


What is true about Shell in the following?
(A). Shell is a multi-faceted program
(B). Shell is the command interpreter
(C). To work in, the shell is a multi-faceted, command interpreter and provides us such an environment
(D). To work in, the shell provides us with such an environment
(E). None of these
MCQ Answer: c


On a single UNIX system, there are multiple kernels.
(A). False
(B). True
(E). None of these
MCQ Answer: a


What is the prompt called issued by the shell?
(A). prompt
(B). command translator
(C). command executor
(D). command prompt
(E). None of these
MCQ Answer: d


Which command will be displaying the name of the shell on which we are working?
(A). echo $SHELL
(B). echo $
(C).echo shell
(D). echo $$
(E). None of these
MCQ Answer: a


___command is used for changing the login shell in some systems (like Linux).
(A). chsh
(B). chshl
(C). chshell
(D). ch
(E). None of these
MCQ Answer: a


For the operating system, the shell provides us with an interface.
(A). False
(B). True
(E). None of these
MCQ Answer: b


There will be ____ shells simultaneously running, on the UNIX system.
(A). many
(B). 2
(C). 1
(D). 4
(E). None of these
MCQ Answer: a


Until we log out of a system, which command does not terminate?
(A). history
(B). login
(C). echo
(D). shell
(E). None of these
MCQ Answer: d


If we need an expression in which the last character is not numeric Which expression is a correct wildcard pattern?
(A). *[!0-9]
(B). *[0-9]
(C). [0-9]
(D). *[!0]
(E). None of these
MCQ Answer: a


When the command is executing, the shell waits for the command to complete and normally it cannot do any work.
(A). False
(B). True
(E). None of these
MCQ Answer: b


There are __ major types of shells in the UNIX.
(A). 3
(B). 2
(C). 4
(D). many
(E). None of these
MCQ Answer: b


In the Bourne shell for command prompt, the default symbol is_____
(A). #
(B). %
(C). $
(D). @
(E). None of these
MCQ Answer: c


The most common and best to use is ______shell
(A). Korn
(B). Bash
(C). C
(D). POSIX
(E). None of these
MCQ Answer: b

Next Operating System MCQs

Computer Science Repeated MCQs Book Download