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 III

Q 1 - Choose the command which can display only your information.

A - who

B - who am i

C - whoisme

D - None of the above.

Answer : B

Explanation

Answer : A

Explanation

Q 3 - Which command can be used to restrict the messages to be written onto you terminal using write command?

A - mesg

B - stop

C - dodge

D - halt

Answer : A

Explanation

You can turn off messages by executing the command – mesg with ‘n’ as argument.

Q 4 - Which character can be used to delete a character at the cursor position in vi?

A - a

B - b

C - x

D - y

Answer : C

Explanation

In the command mode of vi editor ‘x’ removes the character at cursor position.

Q 5 - 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 6 - Which command in command mode of vi saves the file without quitting?

A - :wq

B - :q!

C - :x

D - :w

Answer : D

Explanation

where ‘w’ means as write or say save.

Q 7 - Which of the following is called as here document?

A - <

B - <<

C - >

D - >>

Answer : B

Explanation

Q 8 - 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.

Answer : D

Explanation

User/owner of the is reffered with ‘o’. ‘r’ means read permission bit.

Q 10 - Which command can be used to show OS name?

A - lname

B - uname

C - osname

D - config

Answer : B

Explanation

‘uname’ can display much more technical information about your hardware and OS apart from name of the OS.

Q 11 - Which command can be used to find resource limits?

A - rlimit

B - ulimit

C - mylimit

D - getlimit

Answer : B

Explanation

Q 12 - Switch for ls to view inode number using command ‘ls’ __

A - -i

B - -n

C - -d

D - -a

Answer : A

Explanation

Q 13 - Command to display in the format dd/mm/yy

A - date '+%d/%m/%Y'

B - date '+%d/%m/%y'

C - date '+%m/%d/%y'

D - date '+INDIA'

Answer : B

Explanation

Q 14 - Display the ‘file’ contents page wise

A - cat file|tail

B - cat file|head

C - cat file|more

D - None of the above.

Answer : C

Explanation

‘more’ holds the scrolling page wise. Hit space bar to continue reading to next page. Hit ‘q’ to quit from ‘more’.

Q 15 - 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 16 - Which command can give first found difference between two file after comparing?

A - diff

B - cmp

C - Common

D - None of the above.

Answer : B

Explanation

cmp command is used in general to find for equal files.

Q 17 - Following is the utility program to perform complex mathematical computation.

A - expr

B - bc

C - cal

D - calci

Answer : B

Explanation

bc is often referred to as basic calculator/bench calculator. bc is typically used as either a mathematical scripting language or as an interactive mathematical shell.

Answer : D

Explanation

sed is one of the early Unix commands built for command line processing of data files.

Q 19 - 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 20 - Which command is used to copy file across different system?

A - rcp

B - ftp

C - mcp

D - ncp

Answer : B

Explanation

ftp is the utility available in many platforms which gives the provision of copying files across different system.

Q 21 - Which command is used to change default permissions for files & directories at the time of creation?

A - chmod

B - chown

C - useradd

D - umask

Answer : D

Explanation

umask sets the mask value for files & directories at the time of creation.

Q 22 - 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 23 - Which command can be used to find a word from a text file?

A - cut

B - sort

C - find

D - grep

Answer : D

Explanation

grep is a filter which can match for a pattern/word from lines of the file.

Q 24 - Command used to change group owner of the file __

A - chgrp

B - cgrp

C - group

D - newgroup

Answer : A

Explanation

Q 25 - Which command is used to get intermediate result in a pipeline of commands?

A - tee

B - tea

C - get

D - filter

Answer : A

Explanation

Answer Sheet

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