Unix Mock Test


This section presents you various set of Mock Tests related to Unix Framework. You can download these sample mock tests at your local machine and solve offline at your convenience. Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.

Questions and Answers

Unix Mock Test II

Q 1 - Choose the odd one out.

A - write

B - mail

C - wall

D - read

Answer : D

Explanation

The rest are communication commands.

Q 2 - 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 3 - Which command can be used to delete a file?

A - del

B - remove

C - rm

D - delete

Answer : C

Explanation

rm, can delete a file as well as a directory.

Q 4 - Which character can be used to separate two commands on the same line?

A - :

B - ;

C - ,

D - None of the above

Answer : B

Explanation

Q 5 - Command used to update access and modification times of a file.

A - finger

B - touch

C - tee

D - vi

Answer : B

Explanation

touch can even create an empty file apart from updating access and modification time.

Q 6 - 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 7 - Which command can be used to start the process with the required priority?

A - schedule

B - nohup

C - nice

D - prefer

Answer : C

Explanation

By default OS starts the process with normal priority which can be altered with the help of ‘nice’ command.

Q 8 - Which command can be used to drop a message to all logged in users.

A - mail

B - writeall

C - boradcast

D - wall

Answer : D

Explanation

‘wall’ is considered as broadcasting command. Typically used by admins to pass on important info to all logged in users.

Q 9 - Which option can be used with ‘rm’ command to prompt for file removal?

A - –ask

B - –i

C - -c

D - -n

Answer : B

Explanation

By default ‘rm’ is non interactive. –i means as interactive.

Q 10 - Choose option to list files by modification time.

A - ls –mt

B - ls –t

C - ls –a

D - ls –l

Answer : B

Explanation

–t is to sort by modification time.

Q 11 - Which command can be used to determine file type by its content?

A - file

B - ls –l

C - type

D - None of the above.

Answer : A

Explanation

Command ‘file’ determines the file type by MIME.

Q 12 - Option to mention field separator for the command ‘cut’ is __

A - -f

B - -c

C - -d

D - \0

Answer : C

Explanation

–d means as delimiter, acts as field separator.

Q 13 - 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 14 - 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 15 - Which command can be used to rename a file or a directory?

A - ren

B - mv

C - move

D - rename

Answer : B

Explanation

‘mv’ can also be used to move files/directories from one directory to another.

Q 16 - Which option can be used with ‘chmod’ to apply permission bits recursively on all the files.

A - –r

B - -R

C - –l

D - -f

Answer : B

Explanation

Q 17 - Which is the invalid file name in UNIX?

A - LINUX

B - a.widows

C - bill .gates

D - None of the above

Answer : D

Explanation

Q 18 - Which character is used to search a pattern in the forward direction in vi editor?

A - //

B - :/

C - ?

D - /

Answer : D

Explanation

Q 19 - Choose the correct usage of ‘cd’ to move into parent directory.

A - cd

B - cd..

C - cd/

D - None of the above

Answer : D

Explanation

cd ..(space between cd and ..) is correct instead of cd..

Q 20 - Per user configuration setting are found in the following file of user’s 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 21 - 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 22 - Which command can give disk usage summary?

A - chkdsk

B - fdisk

C - du

D - df

Answer : C

Explanation

du stands for disk usage.

Q 23 - Which is the earliest and most widely used shell in UNIX?

A - bash

B - bsh

C - csh

D - ksh

Answer : B

Explanation

bsh − Bourne shell is the very earliest and most widely used.

Q 24 - What is the key combination to indicate for most of the UNIX command that input is completed?

A - Ctrl+d

B - Ctrl+c

C - Ctrl+x

D - None of the above.

Answer : A

Explanation

As an example you will be logged out when you ctrl+d at console end, indicating no input for the shell.

Q 25 - Which command can be used to query for terminal type being in use?

A - ps

B - ls

C - whoami

D - tty

Answer : D

Explanation

tty − Terminal type.

Answer Sheet

Question Number Answer Key
1 D
2 B
3 C
4 B
5 B
6 A
7 C
8 D
9 B
10 B
11 A
12 C
13 A
14 B
15 B
16 B
17 D
18 D
19 D
20 B
21 C
22 C
23 B
24 A
25 D
unix_questions_answers.htm
Advertisements