Mock Exam Paper Linux
Mock Exam Paper Linux
Question 01 ~ Linux MCQ questions (10 marks - each question carries 1 mark)
Note: Multiple answers are possible for some questions and in that case ‘select all that apply’
quotation is there. If a question has multiple answers, all correct answers must be selected to
be awarded marks.
6. Which command is used to assign read-write permission to the owner of a file called
mytext.txt?
a. chmod og-r mytext.txt
b. chmod a+r mytext.txt
c. chmod o+r mytext.txt
d. chmod o+rw mytext.txt
e. chmod u=rw mytext.txt
7. What is the numerical value for "read" permission in Linux?
a. 1
b. 2
c. 4
d. 0
8. How do you remove a directory in Linux and its contents?
a. rmdir
b. rm -rf
c. delete
d. erase
9. How would you list all files, including hidden ones, in a directory using ls?
a. ls -a
b. ls -l
c. ls -h
d. ls -R
10. To move up one directory level, which command would you use?
a. cd ..
b. cd –
c. cd /
d. cd ~
Mock Examination
Module-Web Development and Operating Systems
Time-1 hour
In the above diagram an oval shape represents a directory, and a rectangle represents a file.
You can assume that Ishan has logged in as the root user and now he is in the root directory.
If he enters the ‘ls’ command, he can see the following result.
As you can see, initially the ‘Introduction to ML.pdf’ file is in the root directory. Also, the
dotted rectangle means nothing exists there and in the later part of this question, it will
come to play.
Mock Examination
Module-Web Development and Operating Systems
Time-1 hour
a. Write all the commands step by step which are required to create the above
directories and file hierarchy. Please note that when you create the above file
system always you should stay in the root directory (i.e you should not
navigate to newly created directories using cd command) [5 marks]
b. Let’s say now Ishan wants to move the ‘Introduction to ML.pdf’ file to the
location of the dotted rectangle. Write down the required command to do
that. [1 mark]
Mock Examination
Module-Web Development and Operating Systems
Time-1 hour
1. Write a bash script to generate first 5 even numbers using a while loop. (0 is not an
even number) [02 Marks]
2.
a. You are tasked with creating a simple ticket price displaying system for an
event. The script should show available ticket types to the users and prompt a
message to select a ticket type to view its price. (You need to use if statements
for this without any functions.) Refer the below information to create your
script. [04 Marks]
Briefly explain why some Linux distros are better than Windows for servers. You should
present at least six (04) different aspects to justify your answer. [10 marks]