Home
MCQS
Unix/Lunux MCQ Quiz Hub
UNIX SYSTEM Mcq
Choose a topic to test your knowledge and improve your Unix/Lunux skills
1. In UNIX, which of the following command is used to set the task priority ?
init
nice
kill
PS
2. Which of the following flags are set when ‘JMP’ instruction is executed ?
SF and CF
AF and CF
All flags
No flag is set
3. Everything below the system call interface and above the physical hardware is known as ______.
Kernel
Bus
Shell
Stub
4. Linux operating system uses
Affinity Scheduling
Fair Preemptive Scheduling
Hand Shaking
Highest Penalty Ratio Next
5. In Unix, how do you check that two given strings a and b are equal?
test $a -eq $b
test $a -equal $b
test $a = $b
both a and c
6. The directory structure used in Unix file system is called
Hierarchical directory
Tree structured directory
Directed acyclic graph
Graph structured directory
7. Which statement is not true about process 0 in the Unix operating system?
Process 0 is called init process
Process 0 is not created by fork system call
After forking process 1, process O becomes swapper process
Process 0 is a special process created when system boots
8. Which or the following commands would return process_id of sleep command?
Sleep 1 and echo $?
Sleep 1 and echo #
Sleep 1 and echo $*
Sleep 1 and echo $!
9. What does the following command do ? grep − vn "abc" x
It will print all of the lines in the file x that match the search string "abc"
It will print all of the lines in file x that do not match the search string "abc"
It will print total no of the lines in file x that match the search string "abc"
It will print the specific line numbers of file x in which there is a match for the string "abc"
10. The Unix Kernel maintains two key data structures related to processes, the progress table and the user structure. Which of following information is not the part of user
File descriptor table
System call state
Scheduling parameters
Kernel stack
11. A Unix file may be of the type :
Regular file
Directory file
Device file
Any one of the above
12. A Unix file may be of the type :
Regular file
Directory file
Device file
Any one of the above
13. 12. Match the following for Unix system calls: List – I List – II (a) exec (i) Creates a new process (b) brk (ii) Invokes another program overlaying memory space with a copy of an executable file (c) wait (iii) To increase or decrease the size of data region (d) fork (iv) A process synchronizes with termination of child process code: a b c d
(ii) (iii) (iv) (i)
(iii) (ii) (iv) (i)
(iv) (iii) (ii) (i)
(iv) (iii) (i) (ii)
14. WOW32 is a :
Win 32 API library for creating processes and threads
Special kind of file system to the NT name space
Kernel - mode objects accessible through Win 32 API
Special execution environment used to run 16 bit Windows applications on 32 - bit machines
15. The Unix command : $ vi file1 file2
Edits file1 and stores the contents of file1 in file2
Both files i.e. file1 and file2 can be edited using 'ex' command to travel between the files
Both files can be edited using 'mv' command to move between the files
Edits file1 first, saves it and then edits file2
16. _______ maintains the list of free disk blocks in the Unix file system.
I-node
Boot block
Super block
File allocation table
17. A part of Windows 2000 operating system that is not portable is
Device Management
Virtual Memory Management
Processor Management
User Interface
18. Match the following with reference to Unix shell scripts : List-I List-II a. $? i. File name of the current script b. $# ii. List of arguments c. $0 iii. The number of arguments d. $* iv. Exit status of last command Codes: a b c d
iii ii i iv
ii iii i iv
iv iii i ii
i iii i iv
19. The output generated by the LINUX command : $ seq 1 2 10 will be
1 2 10
1 2 3 4 5 6 7 8 9 10
1 3 5 7 9
1 5 10
20. In UNIX, ______________ creates three subdirectories: 'PIS' and two subdirectories 'progs' and data from just created subdirectory 'PIS'.
mdkir PIS/progs PIS/data PIS
mkdir PIS progs data
mkdir PIS PIS/progs PIS/data
mkdir PIS/progs data
21. Which statement is not correct about “init” process in Unix?
It is generally the parent of the login shell.
It has PID 1.
It is the first process in the system.
Init forks and execs a ‘getty’ process at every port connected to a terminal.
22. Unix command to change the case of first three lines of file “shortlist” from lower to upper
$ tr ‘[a-z]’ ‘[A-Z]’ shortlist | head-3
$ head-3 shortlist | tr ‘[a-z]’ ‘[A-Z]’
$ tr head-3 shortlist ‘[A-Z]’ ‘[a-z]’
$ tr shortlist head-3 ‘[a-z]’ ‘[A-Z]’
23. Match the following vi commands in Unix: List-I List-II a. :w i. saves the file and quits editing mode b. :x ii. escapes unix shell c. :q iii. saves file and remains in editing mode d. :sh iv. quits editing mode and no changes are saved to the file Codes: a b c d
ii iii i iv
iv iii ii i
iii iv i ii
iii i iv ii
24. The Unix Operating System Kernel maintains two key data structures related to processes, the process table and the user structure. Now, consider the following two statements: I. The process table is resident all the time and contain information needed for all processes, even those that are not currently in memory. II. The user structure is swapped or paged out when its associated process is not in memory, in order not to waste memory on information that is not needed. Which of the following options is correct with reference to above statements ?
Only (I) is correct
Only (II) is correct
Both (I) and (II) are correct
Both (I) and (II) are wrong
25. Consider the following operations to be performed in Unix: “The pipe sorts all files in the current directory modified in the month of “June” by order of size and prints them to the terminal screen. The sort option skips ten fields then sorts the lines in numeric order.” Which of the following Unix command will perform above set of operations?
ls – l | grep “June” | sort + 10n
ls – l | grep “June” | sort + 10r
ls – l | grep – v “June” | sort + 10n
ls – l | grep – n “June” | sort + 10x
26. Which of the following statement(s) is/are True regarding ‘nice’ command of UNIX? I. It is used to set or change the priority of a process. II. A process’s nice value can be set at the time of creation. III. ‘nice’ takes a command line as an argument.
I, II only
II, III only
I, II, III
I, III only
27. In UNIX, processes that have finished execution but have not yet had their status collected are known as ................
Sleeping processes
Stopped Processes
Zombie Processes
Orphan Processes
28. Which of the following information about the UNIX file system is not correct?
Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks.
An i-node contains accounting information as well as enough information to locate all the disk blocks that holds the file’s data.
Each i-node is 256-bytes long
All the files and directories are stored in data blocks
29. Which of the following option with reference to UNIX operating system is not correct?
INT signal is sent by the terminal driver when one types < Control-C > and it is a request to terminate the current operation.
TERM is a request to terminate execution completely. The receiving process will clean up its state and exit.
QUIT is similar to TERM, except that it defaults to producing a core dump if not caught.
KILL is a blockable signal.
30. What is the function of following UNIX command? WC – l < a >b&
It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process.
It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.
It counts the errors during the execution of a process, a, and puts the result in process b.
It copies the ‘ l ’ numbers of lines of program from file, a, and stores in file b.
31. Which of the following statement is not correct with reference to cron daemon in UNIX O.S?
The cron daemon is the standard tool for running commands on a pre-determined schedule.
It starts when the system boots and runs as long as the system is up.
Cron reads configuration files that contain list of command lines and the times at which they invoked.
Cron reads configuration files that contain list of command lines and the times at which they invoked.
32. In Unix, files can be protected by assigning each one a 9-bit mode called rights bits. Now, consider the following two statements: I. A mode of 641 (octal) means that the owner can read and write the file, other members of the owner’s group can read it, and users can execute only. Which of the following options is correct with reference to above statements?
Only I is correct
Only II is correct
Both I and II are correct
Both I and II are incorrect
33. In Unix, the login prompt can be changed by changing the contents of the file ...............
contrab
init
gettydefs
inittab
34. A unix file system has 1-KB blocks and 4-byte disk addresses. What is the maximum file size if i-nodes contain 10 direct entries and one single, double and triple indirect entry each?
32 GB
64 GB
16 GB
1 GB
35. In Unix operating system, special files are used to :
buffer data received in its input from where a process reads
provide a mechanism to map physical device to file names
store list of file names plus pointers associated with i-nodes
store information entered by a user application program or utility program
36. Match the following in Unix file system : List - I List - II (a) Boot block (i) Information about file system (b) Super block (ii) Information about file (c) Inode table (iii) Storage space (d) Data block (iv) Code for making OS ready Codes : (a) (b) (c) (d)
(iv) (i) (ii) (iii) b.
(i) (iii) (ii) (iv) c.
(iii) (i) (ii) (iv)
(iv) (ii) (i) (iii)
37. In Unix, the command to enable execution permission for file “mylife” by all is ................
Chmod ugo+X myfile
Chmod a+X myfile
Chmod +X myfile
All of the above
38. Which of the following out commands will output "onetwothree"?
for val; do echo-n $val; done &lt; one two three
for one two three; do echo-n-; done
for n in one two three; do echo-n $n; done
for n in one two three {echo-n $n}
39. Assume that an implementation of Unix operating system uses i-nodes to keep track of data blocks allocated to a file. It supports 12 direct block addresses, one indirect block address and one double indirect block address. The file system has 256 bytes block size and 2 bytes for disk block address. The maximum possible size of a file in this system is
16 MB
16 KB
70 KB
None of the above
40. Which of the following set of Unix commands will always display “WELCOME” ?
export title=WELCOME; Echo $title
title = WELCOME; export $ title ; sh –c “echo $title”
title = WELCOME; export title ; sh –c “echo $title”
title = WELCOME; echo $title
41. Which of the following shell scripts will produce the output “my first script” ?
for i in my first script { echo –i $i}
for my first script; do echo –n; done
for i in my first script; do echo –i $i; done
for n in my first script; do echo –i $i; done
42. Which of the following statements is not true for UNIX Operating System ?
Major strength of UNIX Operating System is its open standards which enabled large number of organizations ranging from academicia to industries to participate in its development.
UNIX kernel uses modules with well specified interfaces and provides advantages like simplified testing and maintenance of kernel. It has better extensibility as the kernel is not monolithic.
UNIX is kernel based operating system with two main components viz. process management subsystem and file management subsystem.
All devices are represented as files which simplify the management of I/O devices and files. The directories structure used is directed acyclic graph.
43. Consider the following UNIX command: sort < in > temp; head -30 < temp; rm temp Which of the following functions shall be performed by this command?
Sort, taking the input from &quot;temp&quot;, prints 30 lines from temp and delete the file temp
Sort the file &quot;temp&quot;, removes 30 lines from temp and delete the file temp
Sort, taking the input from &quot;in&quot; and writing the output to &quot;temp&quot; then prints 30 lines from temp on terminal. Finally &quot;temp&quot; is removed
Sort, taking the input from &#039;temp&quot; and then prints 30 lines from &quot;temp&quot; on terminal. Finally &quot;temp&quot; is removed
44. The mv command changes
the inode
the inode-number
the directory entry
both the directory entry and the inode
45. A UNIX file system has 1 KB block size and 4-byte disk addresses. What is the maximum file size if the inode contains ten direct block entries, one single indirect block entry, one double indirect block entry and one triple indirect block entry?
30 GB
64 GB
16 GB
1 GB
46. A user level process in Unix traps the signal sent on a Ctrl + C input and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl + C input is given to this process, what is the mode in which the signal handling routine executes ?
User mode
Kernel mode
Superuser mode
Privileged mode
47. Which one of the following options is not a shell in UNIX system?
Bourne Shell
C Shell
Net Shell
Korn Shell
48. Which command allows you to view your file 24 lines at a time ?
More
Cat
Pg.
None of the above
49. The Unix command used to find out the number of characters in a file is
nc
wc
chcnt
lc
50. Find the odd man out:
tail
cut
wart
sed
51. Which of the following changes permission to deny write permission to group and others?
Chmod go-w filex
Chmod go w filex
Chmod go=w filex
None of the above
52. Which of the following OS treats hardware as a file system?
UNIX
DOS
Windows NT
None of the above
53. An example of a memory management system call in UNIX is:
fork
mmap
sigaction
execve
54. An example of a directory found in most UNIX system is:
usr
waitpid
brk
unmap
55. The “nice” command is used in Unix:
to decrease the priority of a process
to increase the priority of a process
to get the highest priority
both a and b
56. Which of the following is not an Unix Command ?
Whoami
wc
is
put
57. A system call in Linux operating system to create a new child process, which is a copy of the parent process:
access
fork
flock
exec
58. The environment variable in Linux, that contain a list of directories the shell automatically recognizes.
$PATH
$ENV
$USER
$GREP
59. In Linux, the subdirectory that contains system configuration files including user passwords:
/boot
/usr
/etc
/proc
60. Linux partitions are created using the file system:
FAT
FAT32
EXT3
NTFS
61. Which UNIX/Linux command is used to make all files and sub-directories in the directory “progs” executable by all users?
chmod −R a+x progs
chmod −R 222 progs
chmod −X a+x progs
chmod −X 222 progs
62. Consider the following statements : (a) UNIX provides three types of permissions * Read * Write * Execute (b) UNIX provides three sets of permissions * permission for owner * permission for group * permission for others Which of the above statement/s is/are true?
Only (a)
Only (b)
Both (a) and (b)
Neither (a) nor (b)
63. Match the following WINDOWS system calls and UNIX system calls with reference to process control and File manipulation. Windows (a) Create - process () (b) WaitForSingleObject () (c) CreateFile () (d) CloseHandle () UNIX (i) Open () (ii) Close () (iii) Fork () (iv) Wait () Code : (a) (b) (c) (d)
(iii) (iv) (i) (ii)
(iv) (iii) (i) (ii)
(iv) (iii) (ii) (i)
(iii) (iv) (ii) (i)
Submit