Unix / Linux Online Quiz



Following quiz provides Multiple Choice Questions (MCQs) related to Unix Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Q 1 - Choose the odd one out.

A - csh

B - bsh

C - ksh

D - Kernel

Answer : D

Explanation

Kernel is the core part of the OS and is odd one the rest are popular shells.

Q 2 - Which shell variable holds the first command line argument for a shell script?

A - $0

B - $1

C - #0

D - None of the above

Answer : B

Explanation

$0 represent the shell script file name itself. Starting with $1, are actual command line arguments sent to the shell script.

Q 3 - Which command can be used to remove a non-empty directory?

A - rmdir

B - rd

C - ddir

D - rm

Answer : D

Explanation

rmdir can be used only if the directory is empty. We can remove the directory if non-empty using recursive option with rm, as a directory is even a file for UNIX/Linux.

Q 4 - Following file contains the encrypted password of the users.

A - /etc/passwd

B - /etc/shadow

C - /etc/gshadow

D - /etc/user.conf

Answer : B

Explanation

Q 5 - General purpose UNIX command are found typically in the following directory.

A - /dev

B - /sbin

C - /bin and /usr/bin

D - /tmp

Answer : C

Explanation

Q 6 - Which command can be used to create links for file/directory?

A - lk

B - ln

C - new

D - makelink

Answer : B

Explanation

ln is the command used to create hard/soft link for a file and hard link for a directory.

Q 7 - Which command can be used to count characters in a text file?

A - ccount

B - fsize

C - count

D - wc

Answer : B

Explanation

wc, apart from counting characters it can also count number of line & words.

Q 8 - Which switch of rm command is used to remove a directory with all its subdirectories forcibly?

A - rm rfi

B - rm ri

C - rm rf

D - rm r

Answer : C

Explanation

r mean recursively and f means forcibly.

Q 9 - Identify the command to remove a directory from directory stack.

A - pushd

B - popd

C - eject

D - enqueue

Answer : B

Explanation

Q 10 - Identify the invalid run level from the following.

A - S

B - 1

C - 0

D - 8

Answer : D

Explanation

unix_questions_answers.htm
Advertisements