Unix Multiple Choice Questions with answers


1.Path is used to locate file in Unix filesystem. The types of path supported are _ and______

Absolute
Relative

2.Which command in UNIX is used for clearing the Screen?

ans. clear

3.Below statement is an example of _ path in Unix
&cd /home/course/CSE/C++

Ans. Absolute

4.Predict the output of below command
grep “Atul” employee.txt || echo “not found”

Ans.Searched for Atul and echoes “not found” when not found

5.Unix file system is a collection of files and directories organized in a __ manner

Ans- hierarchical

6.The kernel is the core part of UNIX operating system. Choose 3 tasks achieved by Kernel from
the list below

Ans-
Performs disk operations
Manages I/O operations
Performs memory and processes management

7.Root is a super user in Unix operating system and it is represented using _

Ans – /

8.Name the Unix command to perform safe shut down a Unix system

Ans – Shutdown

9.Predict the output of the following command
$ who | tee userlist.txt

ANS – he command displays the output of who in the monitor and also saves the output in userlist.txt

10.UNIX is more commonly used operating system in comparison with other OS. Choose two
reason from the below options in support of this statement.

Ans-
It is open source software
It is highly secure

11.Which command is used to get intermediate result in a pipeline of commands in Unix

Ans-tee

12.Which of the following options in UNIX can be used for printing the calendar for December 2019?

Ans-
$ cal 12 2019
$ cal dec 2019
$ cal December 2019

13.Kernel of UNIX operating system is written using _

ANS – C

14.Which option can be used to perform a forward search of string in the vi editor

Ans-
/string

15.Unix executables are stored in which path?

ANS – /bin


16.Which command can be used for navigating 5 pages forward in vi editor

Ans-
5 ctrl + f

17.A system administrator needs to identify different types of files in the UNIX system. Help by
matching the correct symbols used to identify the file type1- 2. l 3.b 4.c
With
a. Regular file b. Link file c. Block device file d. Character device file

Ans-
1-A, 2-B, 3-C, 4-D

18.Match the appropriate options to move cursors in the vi editor 1. l 2. k 3. h 4. b
With
a. move cursor down one line
b. move cursor up one line
c. move cursor left one line
d. move cursor to beginning of next word

Ans-
1-A, 2-B. 3-C, 4-D

19.Which command can be used in vi editor to delete 10 lines?

Ans – 10 dd

20.Which of the following is not a feature of UNIX?

a. Multiuser
b. Portability
c. Multitasking
d. User friendly

Show Answer

Ans: D

21.Unix Terminals are called Dummy terminals as they do not have _ capability.

ANS – Processing

22.Consider the sample.txt file and predict the output 
Unix is an operating system. 
Unix is open source.
 Linux is also a powerful OS. 
What is the output of grep -c “Unix” sample.txt command?

ANS – 2

23.What does the below Unix command accomplish? 
$ sed ‘s/ABC/ZYX/’ file.txt

ANS – Replaces first occurrence in every line ‘ABC’ with ‘ZYX’

24.Which of the following should be used to print lines containing ‘manager’ in emp.lst?

a. awk ‘manager { print }’ emp.lst
b. awk ‘/manager { print }’ emp.lst
c. awk ‘/manager/ { print }’ emp.lst
d. awk ‘/manager/ { print } emp.lst

Show Answer

Ans: C

25.which of the following option can be used ,in order to quit vi editor without saving the work done ?

a. :q!
b. :w
c. :q

Ans: A


Leave a Reply

Your email address will not be published. Required fields are marked *