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 file descriptor number which represents the STDOUT?

A - 0

B - 1

C - 2

D - None of the above.

Answer : B

Explanation

0-STDIN, 1-STDOUT & 2-STDERR

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 - Choose the correct option to replace all the occurrences of pattern1 with pattern2 using vi editor.

A - :%s/pattern1/pattern2/g

B - :%s/pattern1/pattern2/G

C - %s/pattern1/pattern2/G

D - :%s/pattern1/pattern2/G

Answer : A

Explanation

g indicate to replace globally.

Q 5 - Per user configuration setting are found in the following file of users home directory.

A - profile

B - .profile

C - .mbox

D - .exrc

Answer : B

Explanation

Aliases, imported environment variables, etc are part of the configuration settings.

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 - What are the options used to list the contents of a .tar file?

A - cvf

B - tvf

C - xvf

D - lvf

Answer : B

Explanation

t to list out, v is verbose mode & f for target file.

Q 9 - Mount point for templorary removable devices is ___

A - /

B - /mnt

C - /dev

D - /tmp

Answer : B

Explanation

Q 10 - Job number and PID are same.

A - True

B - False

Answer : B

Explanation

PID is given by OS, whereas Job number is the utility program which initiates process.

unix_questions_answers.htm
Advertisements