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 - What is the option to create symbolic link for a file?

A - s

B - l

C - f

D - None of the above.

Answer : A

Explanation

-s is the option to create a symbolic/soft link and applicable for only files.

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 is following key moves the cursor to the end of the line in vi editor?

A - 0

B - $

C - {

D - }

Answer : B

Explanation

Q 4 - Which mail command can be used to save the mail onto a file?

A - s

B - f

C - d

D - w

Answer : A

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 - Choose the correct from below to search for lines ending with the pattern using grep.

A - ^pattern

B - pattern^

C - $pattern

D - pattern$

Answer : D

Explanation

The pattern can be enclosed in single quotes to suppress meaning of all the meta-characters special meanings.

Q 7 - How can you execute date command staying within vi editor?

A - !date

B - :!date

C - :>date

D - Noe of the above

Answer : B

Explanation

Staying in command mode of vi, hit : and any command following exclamation (!).

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.

Answer : C

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