126
81.3k

80+ Unix Operating System Solved MCQs

These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Bachelor of Science in Computer Science SY (BSc CS) , Bachelor of Science in Computer Science (BSc CS) .

51.

On executing a statement set -3+1

A. $1 would be -3
B. $1 would be –
C. $1 would be set
D. this command would result into an error
Answer» D. this command would result into an error
52.

On executing the command Shift $v

A. the positional parameters would be shifted by the value of the variable v
B. the positional parameters would be shifted by 1
C. the positional parameters would not be shifted at all
D. this command would result into an error
Answer» A. the positional parameters would be shifted by the value of the variable v
53.

Which of the following shows the correct hierarchy of arithmetic operations in shell

A. (),**,* or /, + or –
B. (), **, *,/,+,-
C. (),**,/,*,+,-
D. (),/,% or *,- or +
Answer» D. (),/,% or *,- or +
54.

Which of the following is allowed in an arithmetic statement involving exprinstruction

A. []
B. {}
C. ()
D. none of the above
Answer» C. ()
55.

The statement z=’expr 5/2’ would store in z a value

A. 2.5
B. 3
C. 2
D. 0
Answer» C. 2
56.

The expression expr -7 % 2evaluates to

A. 1
B. -1
C. -3.5
D. 0
Answer» B. -1
57.

The expression expr -2 % 7 evaluates to

A. 2
B. -2
C. 0
D. 0.285
Answer» B. -2
58.

Hierarchy decides which operator

A. is most important
B. is used first
C. is fastest
D. operates on largest numbers
Answer» B. is used first
59.

The break statement is used to exit from

A. an if statement
B. a for loop
C. a program
D. none of the above
Answer» B. a for loop
60.

An until loop ensures that the statement within the loop get executed

A. only once
B. atleast once
C. not even once
D. none of the above
Answer» D. none of the above
61.

Which option will be used with sort command to start sorting after the nth column of the (m+1)th field

A. –m.n
B. +m.n
C. +n.m+1
D. +(m+1).n
Answer» B. +m.n
62.

Which command is used to terminate a process

A. shutdown
B. haltsys
C. cancel
D. kill
Answer» D. kill
63.

The command is used to compare the files is known as

A. comp
B. cmp
C. do
D. ccp
Answer» B. cmp
64.

The command which transcribes the standard input to the standard output and also makes a copy of the same in a file is

A. tee
B. tr
C. sort
D. grep
Answer» A. tee
65.

Which command is used to remove a directory

A. rd
B. rmdir
C. dldir
D. rdir
Answer» B. rmdir
66.

Which of the following keys is used to replace a dingle character with new text

A. s
B. s
C. r
D. c
Answer» B. s
67.

Which command is used to extract a specific columns from the file

A. cat
B. cut
C. grep
D. paste
Answer» B. cut
68.

Which command sends the word count of the file infile to the newfile.

A. wcinfile>newfile
B. wcnewfile
C. wcinfile - newfile
D. wcinfile | newfile
Answer» A. wcinfile>newfile
69.

Which command is used to remove the read permission of the file 'note' from both the group and others?

A. chmodgo+r note
B. chmodgo+rw note
C. chmod go-x note
D. chmod go-r, 4-x note
Answer» D. chmod go-r, 4-x note
70.

Which command is used to concatenate all files beginning with the string 'emp' and followed by a non-numeric characters?

A. cat emp[!0-9]
B. more [emp][!0-9]
C. cat emp[x-z]
D. cat emp[a-z]
Answer» A. cat emp[!0-9]
71.

Which command will be used with vi editor to insert text to left of cursor?

A. s
B. s
C. a
D. i
Answer» D. i
72.

In vi editor, forward search is performed using the command.

A. :pat
B. :pat
C. /pat
D. all of the above
Answer» D. all of the above
73.

Which of the following special shell variables is used to process number of the last background job?

A. $!
B. $#
C. $0
D. $*
Answer» A. $!
74.

Which option will be used with ps command to slow the entire command line of the process being run?

A. -4
B. -f
C. -1
D. -4
Answer» B. -f
75.

Which of the following command addresses all users who are currently hooked on?

A. write
B. mail
C. wall
D. mesg
Answer» C. wall
76.

Which of the following commands is used to identify the type of file by context?

A. ls
B. cat
C. file
D. more
Answer» C. file
77.

The filed separator in cut command is specified with

A. -a option
B. -d option
C. -r option
D. -x option
Answer» B. -d option
78.

Which of the following options will be used to display number of blocks used by a file?

A. -c
B. -i
C. -d
D. -s
Answer» D. -s
79.

Which option will be used with touch command to change the access time?

A. -a
B. -b
C. -t
D. -h
Answer» A. -a
80.

Which command is used to make all files and sub-directories in the directory (progs) executable by all users?

A. chmod -r a+xprogs
B. chmod -r 222 progs
C. chmod -1 a+xprogs
D. chmod -x a+xprogs
Answer» A. chmod -r a+xprogs
81.

Which command is used to display and create files?

A. cat
B. vi
C. ed
D. lyrix
Answer» A. cat
82.

The second set of the three permissions (r-) indicates that

A. group has read permission only
B. other has read permission only
C. owner has read permission only
D. group has write permission only
Answer» A. group has read permission only

Done Studing? Take A Test.

Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.