MCQ - LPS Linux Questions
MCQ - LPS Linux Questions
1. Which commands are used to list all the files in the current directory (including the
hidden commands)?
a. ls-l
b. ls-a
c. ls-t
d. ls-I
2. __________ is the shell that is used for a single user mode.
a. Bash
b. Csh
c. Ksh
d. Sh
3. Single user mode shell runs as a(n) __________.
a. Admin user
b. Root user
c. Normal user
d. Log user
4. Which of the following are the true functionalities of a kernel?
a. Allocates time and memory to programs
b. Authenticates users
c. Interprets commands
d. All of the above
5. A shell is ___________________
a. An interface between the kernel and the hardware
b. An interface between the user and the applications
c. Acommand interpreter
d. A command compiler
6. The command cat n file will ________________________
a. Add a new line after every thingof the output
b. Add line numbers to every line of output
c. Will show only number of lines
d. None of the above.
7. Which of the following will show the first 5 lines of the input file?
a. Less -5 filename
b. Head -5 filename
c. More -5 filename
d. None of the above
8. cat file.txt | less
The above command __________
a. Shows error
b. Displays one page
c. If a file has a large number of containers that wont fit in the output terminal,
thescreen scrolls up very fast
d. None of the above
9. Which command is used to read file and display the file at a time?
a. Head
b. More
c. Tail
d. Less
10. $ mkdir dir5
$ cd !$
What is the output of the above piece of code?
a. Points to dir5
b. Points to home directory
c. Shows the path
d. None of the above
11. Which of the following commands gives the available space mounted on the file system?
a. Du
b. Df-h
c. Du-sh
d. Free
12. Which command is used to assign read-write permission to the owner?
a. Chmoda+r file
b. Chmodo+r file
c. Chmod u=rw file
d. Chmodog-r file
a.
b.
c.
d.
20. In Ethernet frame, the destination and source are MAC addresses of size____.
a. 32
b. 48
c. 64
d. 16
21. One of the following layers organizes and synchronizes the exchange of data between the
application processes.
a. Application layer
b. Session layer
c. Presentation layer
d. Transport layer
22. If the sender is a host and wants to send a packet to another host on another network,
which of the following should be the logical address that must be mapped to a physical
address?
a. The destination IP address in the datagram header
b. The IP address of the router found in the routing table
c. Both aand b
d. None of the above
23. X.25 is an example of which of the following network(s)
a. Circuit switched
b. Packet switched
c. Network switched
d. Both a and b
24. In classless addressing, for example 10.1.1.32/47(subnet mask: 255.255.255.240) defines
the range 10.1.1.32 to 10.1.1.47, then the broadcast address is _____.
a. 10.1.1.32
b. 10.1.1.33
c. 10.1.1.47
d. 10.1.1.46
25. What is the command used to copy multiple files (with an extension .v) from the local
machine to the remote server?
a.
b.
c.
d.
put *.v
mget *.v
mput *.v
get *.v
26. The control access file which specifies the ftp host access and deny parameters is ____.
a. ftp access
b. ftp conversions
c. ftp hosts
d. xferlog
27. ____ is the location of the file which contains the extended group attributes.
a. /etc/group file
b. /etc/security/group file
c. /var/log/groups
d. /var/log/security/group file
28. _____ protocol provides a directory service that lets users query a database of network
resource information.
a. PPP
b. LDAP
c. DNS
d. AMBA
29. Email is transmitted on internet via ______.
a. HTTP
b. FTP
c. SMTP
d. PPP
30. The server handle requests for other domains are done ________.
a. directly
b. by contacting remote DNS server
c. It is not possible
d. indirectly
a.
b.
c.
d.
Sharing
Persistence
Distributed cache
All of the above
33. One of the following modules accesses and allocates disk blocks.
a. Access control module
b. Block module
c. File access module
d. None of the above
34. One of the following gets the file attributes for file name into buffer.
a. count=read(filedes, buffer,n)
b. count=write(filedes, buffer,n)
c. status=stat(name, buffer)
d. status =link(name1,name2)
35. Which of the following is an example of DFS?
a. RAM
b. Web server
c. AFS
d. Sun NFS
36. One of the following modules contains disk I/O and buffering.
a. Block module
b. Access control module
c. Device module
d. None of the above
37. In one of the following transparencies, the naming of file system is controlled by client
mount operations.
a. Mobility transparency
b. Location transparency
c. Scalability transparency
d. Access transparency
38. One of the following file system operationsis used to move read-write pointer to the
offset.
a. lseek()
b. link()
c. unlink()
d. close()
39. One of the following file system operations delivers a UFID for the file.
a. create()
b. open()
c. read()
d. write()
40. Which block in NFS architecture is used to identify local and remote files?
a. Virtual file system
b. NFS server
c. UNIX file system
d. NFS client
41. NFS is a
a.
b.
c.
d.
i)&iv)
i), iii)&iv)
ii)&iv)
i) only
b. 1
c. 2
d. 3
51. Which Symbol is used for Interpolation in PERL?
a. =~
b. {}
c. ()
d.
52. Given@food=("raj","ram","venki"); What is the output of @food.""; ( Procedural)
a. Rajramvenki
b. Raj ram venki
c. 3
d. @food
53. What is the operator used for a function call?
a. &print_header();
b. &print_header
c. @print_header();
d. Both a&b
54. ______ is the keyword used to load standard functions in PERL.
a. put fname.pl
b. require fname.pl
c. use fname.pl
d. get fname.pl
55. One of the following string matching operatorsis used in PERL scripting?
a. =~s
b. /string/
c. \string\
d. string
c. Logical Operators
d. ->,++,--,**
58. What is the output of the following
@array = (1,3,sort 4,2);
Print @array;
a. 1342
b. 1234
c. 1324
d. Error
59. What would be the output of the following program?
use strict;
usewarnings;
my $x = 6P;
my $y = 3;
print $x . $y;
a.
b.
c.
d.
6P.3
$x . $y
6P3
Warning/Error
65. $a = 4;
print $a--;
print --$a;
will print
a. 2,4
b. 2,2
c. 4,2
d. 4,4
66. $result=14;
print The value \ of \$result is $result \\n;
a. The value of 14 is 14
b. The value of $result is $result
c. The value of $result is 14 \n
d. The value of $result is 14
67. @array=(1,2,3,4);
$array[6]=17;
$array[7]=22;
$array[1]=5;
print @array;
a. 1 5 3 4 17 22
b. 1 5 3 4 undefundef 17 22
c. 1 2 3 4 undefundef 17 22
d. None of the above
68. What is the output of the following code snippet when arrays @c and @d are printed?
@a = (1,5,7);
@color=(violet,green,blue);
@c=(0,@a,9);
@d=@e=@color;
a.
b.
c.
d.
b. undef @list
c. @list=undef
d. both 1&2
74. A reference to a list and a hash is created by enclosing a list in _____ and ______
respectively.
a. [] , []
b. {} , []
c. [] , {}
d. {} , {}
75. If @a=(a,b,c,1,2,3) then print slice=@a[@a[3,4,5]]\n; ( Procedural)
a. bc1
b. abc
c. 123
d. c12
76. If @a=(x,y,z) then what will be the value of print there are , .@a elements \n
a. xyz
b. .xyz
c. 3
d. ,.xyz
77. In Hashes, a hash table is often used to implement ______.
a. Packed array
b. Associative array
c. Unpacked array
d. Fixed array
78. If an array is assigned to a hash, the even index elementsand the odd index elements
correspond to __________. .
a. Value, key
b. Keys, keys
c. Key, value
d. Value, value
79. Hash variables are named beginning with the character.
a. #
b. %
c. $
d. @
80. One of the following operators will delete all the contents in the hash.
a. Remove
b. Delete
c. Undef
d. Any of the above
81. Which of the following is true statement?
a. If $r = \@list then $$r[3] is the element at index 3 of @list
b. $r->[3] is also the element at index 3 of @list
c. $r[3] is the element at index 3 of @r, completely unrelated
d. All the above.
82. Which operator indicates a pattern matching?
a. m
b. pm
c. mp
d. p
83. What does the >> operator indicate in a file?
a. Appending to a file that already exists
b. Opening a file
c. Deleting the context
d. None of the above
84. What does the > operator indicate?
a. Appending to a file
b. Opening a file
c. Deleting context of an existing file.
d. Both b and c
85. Parameters in the fun call are called _______.
a. formal parameters
b. actual parameters
c. functional parameters
d. regional parameters
86. One of the following functions is used to position the file handle cursor at different
positions.
a. Read
b. Seek
c. Head
d. More
87. Which character stores the value which is matched with pattern?
a. $`
b. $
c. $&
d. None of the above
88. Default delimiter in split command is ____________.
a. Single space
b. Tab space
c. ,(coma)
d.
89. Which of the following is used to check whether the pattern is not matched
a. =!/
/
b. =~/
/
c. !~/
/
d. None of the above
101.
102.
103.
104.
Set b\%a
set a 4
expr $b*2
a.
b.
c.
d.
105.
4
6
8
10
106.
4
5
x+10
None of the above
Variable interpolation is caused by one of the following.
white space
\
#
$
Command interpolation is caused by one of the following.
a. \
b. $
a.
b.
c.
d.
107.
c. %
d. []
108.
a.
b.
c.
d.
109.
110.
set b\%a
set a 4
expr $b*2
a. 4
b. 6
c. 8
d. 10
Output of tcl program
set x 4 ;
sety x+10;
a. 4
b. 5
c. x+10
d. none
111.
Stack trace
Error information
Control over files
Global info
a.
b.
c.
d.
112.
113.
d. Stacktrace
114.
115.
a.
b.
c.
d.
116.
Figure out the current month and year, date(d) returns a string like: Sun Sep 22
22:26:10 PDT 1996
a. set month [lindex $d 2], set year [lindex $d 6]
b. set month [lindex $d 1], set year [lindex $d 5]
c. set month [lindex @d 2], set year [lindex @d 6]
d. set month [lindex @d 1], set year [lindex @d 5]
a.
b.
c.
d.
a.
b.
c.
d.
a.
b.
c.
d.
117.
118.
119.
120.
d. fget command
121.
a.
b.
c.
d.
a.
b.
c.
d.
a.
b.
c.
d.
122.
123.
124.
Object-oriented commands
Action-oriented commands
Formatting commands
None of the above
a.
b.
c.
d.
a.
b.
c.
d.
TCL commands for normal completion and error are ______ respectively
OK, ERROR
TCL . OK, TCL . ERROR
TCLOK, TCLERROR
TCL_OK, TCL_ERROR
125.
126.
127.
a.
b.
c.
d.
128.
a 1
b 3
c 5
xa?b:c
a. 3
b. x
c. b
d. a
129.
130.
131.
Python Script:
a is 6
a ++
b is 3
a += b
Value of a, b at the end of the script
a. 10,3
b. 9,3
c. 6,3
d. Error
132.
133.
134.
For immutable and mutable objects, how does the python script act?
a. Pass by reference,pass by value
b. Call by value, call by reference
c. Pass by value, pass by reference
d. None of the above
135.
136.
137.
138.
139.
140.
141.
142.
143.
144.
Which of the following makes ^ and $ before and after each line break in a string?
a) re. IGNORECASE
b) re.DOTALL
c) re.MULTILINE
d) None of the above
145. Which of the following contains a tuple containing the (start,end) positions of the
match?
a) group()
b) start()
c) end()
d) span()
146.
147.
>>>len([0,2,rose])
a. 1,4,3
b. 4,1,3
c. 1,1,3
d. 4,3,1
148.
149.
150.
[1,2,rose]
[rose,1,2]
[1,2,rose]
None of the above