Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Linux test paper2
1. Linux Test Questions
Multiple Choice Questions
1. MBR Is locatedinwhichsectorof Hard disk
a. FirstSector
b. SecondSector
c. Entire Disk
d. None of the above
2. This daemon is used to start samba server.
a) vsftpd
b) nfs
c) smb
d) All of the above
3. ThisUtilityin Linux can be usedto create new user
a. CreateUser
b. Usermod
c. Useradd
d. None of the above
4. What isthe Outputof followingcommand
ls –l | tr –s “ “ | cut –d “ “ –f5
a. Size of file
b. Size of all files
c. CombinedSize of all files
d. None of the above
5. What isKernel
a. Setof code whichdirectlyinteractswithhardware
b. Manages ResourcessuchasCPU time,memoryandI/OAccess
c. LoadedintoRAMat boottime
d. All of the above
6. Thisprocessis the firstprocessinplace of init Linux
a. xfsdump
b. tar
c. systemd
d. None of the above
2. 7. You accept 2 arguments as n1 and n2 to the shell script as 100 and 2
What will be the output if script is written as follows :
#!/usr/bin/bash
ans=`expr $n1 * $n2`
a. 100 * 2
b. 200
c. error
d. None of the above
8. Thisis one of the Kernel Functions
a. MemoryManagement
b. ProcessManagement
c. File Management
d. All of the above
9. ThisUtility/Service isusedtomanage NetworkInterface inLinux 7and above
a. Service-config-network
b. Service-configure-network-interface
c. NetworkManager
d. None of the above
10. Evaluate the foll: script – test.sh
#!/usr/bin/bash
for x in 1 2 3 4 5
do
echo $x
sh test.sh
done
what will be the output if executed
a) 1 2 3 4 5
b) 1 in infinite loop
c) 1 2 3 4 5 in in infinite loop
d) Error
3. 11. Write Shell Script forthe following:
A] Create the file employee.txt having colon (: ) separated fields.
The fields of the record are: enumber, ename, eposition, esal, edoj, edept.
(Accept Details till user enters STOP )
Answer the following:
a. List all the employees along with a row number
b. Sort the file as per the names
c. List top three salaried employees
d. Remove duplicate records from the file
e. Sort the file in descending order of salary
B] Write a Script forthe following:
1. For all those Users whoare loggedin
a. Greetthemwith‘Welcome toLinux Learning’
b Displayeveryusershome directory,whichshelltheyare workingon
and terminal onwhichtheyare working
2. Acceptfile name andintegerfrom user
Displayall linesfromthatfile startingfromthatinteger
3. Accepta FileName fromuseranddisplayitinreverse –onlyfile name(iffileexists)
(note : do notuse any inbuiltfunctionif present)
12. Write commandsfor the following
a. Findout whetherthe userswith a pattern“myuser” in their names have logged in ?
b. Assign a value “Black” to var1 and then display the following message on the
terminal using this variable.
Black beltis associatedwith karate
c. Accept Year ofBirth as command line and displayAge
d. Remove all Empty filesfrom your folder
e. Display all the fileslistingindescendingorderor theirsize