Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Unit 7 to 10

Total questions: 40

Worksheet time: 23mins

Name
Class
Date
1.

What is the purpose of $# Special Variable ?

a)

Return Number of variable

b)

Return number of arguments

c)

Return arguments

d)

None of the above

2.

What is the purpose of $* special variable ?

a)

Return arguments

b)

Return number of arguments

c)

Return value of the variable

d)

None of the above

3.

What is the purpose of $@ special variable ?

a)

Returns number of arguments

b)

Returns number of variables

c)

Returns arguments

d)

None of the above

4.

Which command using special variable can print script name ?

a)

echo $#

b)

echo $@

c)

echo $0

d)

echo #!

5.

What is the contents of /etc directory ?

a)

Configuration files

b)

Variable files

c)

Log files

d)

None of the above

6.

What is the contents of /var directory ?

a)

log files

b)

configuration files

c)

it's an empty directory

d)

None of the above

7.

What is the contents of a directory /var ?

a)

Spool directory

b)

configuration files

c)

device files

d)

None of the above

8.

What is the location of dmesg files ?

a)

/etc/log

b)

/var/log

c)

/etc

d)

I forgot because I didn't had breakfast

9.

What is the content of dmesg files ?

a)

Kernel related messages retrieved from logs

b)

configuration related messages retrieved from /etc

c)

Kernel related messages retrieved from kernel buffer

Services initialized on boot-up of system

d)

Eat Almonds daily to know exact answer

10.

What is the purpose of httpd deamon ?

a)

Web server deamon, Apache Hyper Text Transfer Protocol Deamon.

b)

Kernel server deamon, Hyper Text Transfer Protocol Deamon.

c)

Log server deamon.

11.

What is the purpose of mysqld deamon ?

a)

Database service deamon and Mysqld.log is a record of what mysqld is doing & keep records of when clients connect or disconnect

b)

Server service deamon and Mysqld a record of what mysqld is doing & keep records of when clients connect or disconnect

c)

Configuration service deamon and Mysqld.log is a record of what mysqld is doing & keep records of when clients connect or disconnect

d)

Variable service deamon and Mysqld.log is a record of what mysqld is doing & keep records of when clients connect or disconnect

12.

syslog.conf / rsyslog.conf file is a configuration file and it's function is a) ___________ & b) ________________ (Tick all correct answers)

a)

Control the behavior of system

b)

Allow admin to control, change where system log files are stored

c)

Allow admin to control and change any types of file system

d)

All three answers are correct

13.

What is the purpose of init.d deamon ? Tick all correct answers.

a)

Allow to change how the system behave.

b)

Initialize during the boot process of your system

c)

Contains a number of start-up and stop scripts for various services on your system

d)

Allow to change boot path.

14.

What is the content of passwd file in /etc directory?

a)

Contains the Users online.

b)

Contain the user encrypted passwords

c)

Contain the user passwords

d)

Contains the user account details

15.

What is the content of shadow file in /etc directory ?

a)

User encrypted passwords

b)

User Account details

c)

User and group encrypted passwords

d)

None of the above

16.

Su and sudo allow users to run as superusers or root.

a)

True

b)

False

17.

You can use "su" to switch to any user account

a)

True

b)

False

18.

You cannot use su to switch to any user account.

a)

True

b)

False

19.

Sudo keeps a log for the commands which were executed.

a)

True

b)

False

20.

What is correct about su and sudo ? Select two answers.

a)

su command stands for substitute user or switch user

b)

sudo command stands for superuser do.

c)

both su and sudo are same and can be used interchangeably.

d)

su minimizes the risk of accidental system-wide changes and enhances security.

21.

What is correct about /etc/sudoers.d. (Select two options).

You can refer to Unit 10 ppt to answer this question.

a)

This file is checked before allowing users to login.

b)

This file is typically preserved during system upgrade

c)

 To see if the user is authorised to use sudo

d)

This file help admin to troubleshoot the system

22.

/var contains spool directories, log files, accounting information and various other items.

a)

True

b)

False

23.

Linux/Unix, allow you to put a list of commonly used commands into a text file and run them all together. What is this kind of file called in Unix like operating systems.

a)

Shell Script

b)

Shell

c)

Shell file

d)

Scripting demon file

24.

What permission is required before you run a script ?

a)

Execute

b)

Read

c)

Write

d)

None of the above

25.

What is the correct command to change permission before you run ./script.

a)

chmod +x scriptName

b)

chmod +r scriptName

c)

chmod +w scriptName

d)

None of the above

26.

What is the purpose of the first line in your script #!/bin/bash

a)

Special comment to inform compiler about bash interpreter

b)

Special comment to inform compiler that you are running a script

c)

Special comment to inform compiler about Operating system.

d)

None of the above

27.

Which command is correct to store the value of 5 in the variable called num

a)

num = 5

b)

num=5

c)

5=num

d)

numis5

28.

What system will print if you write a command echo $user

a)

The password of the user running the script

b)

The crontab of the user running the script

c)

The process status of the user running the script

d)

The username of the user running the script

29.

What ":echo $USERHOST" command will print on screen.

a)

The web server of the machine the script is running on

b)

The username of the machine the script is running on

c)

The hostname of the machine the script is running on

d)

The server name of the machine the script is running on

30.

What are $1 to $9 are called in bash script.

a)

The first 9 usernames to the Bash script

b)

The first 9 arguments to the Bash script

c)

The first 9 file names to the Bash script

d)

None of the above

31.

$LINENO - Returns the _____________ number in the Bash script.

a)

Random line

b)

current line

c)

Input and output line

d)

None of the above

32.

How does for loop ends

a)

done

b)

do

c)

enod

d)

None of the above

33.

How function starts and ends. (Using what symbols)

a)

{ }

b)

[ ]

c)

( )

d)

None of the above

34.

What does crond process does ?

a)

crond process find the list of devices to schedule and

It looks in every devices cron  data-base

b)

crond file is a deamon and it find the list of jobs to end and

It looks in every user’s crontab data-base

c)

crond process find the list of jobs to schedule and

It looks in every user’s cron  data-base

35.

Look at the crontab below and select the correct answer.

10 13 8 12 0 /bin/bash /home/imran/script.sh

a)

This crontab will run the script.sh at 10:13 on 8th December and on Sunday

b)

This crontab will run the script.sh at 13:10 on 8th December or on Sunday

c)

This crontab will run the script.sh at 13:10 on 8th December on Sunday

d)

None of the above

36.

Select the correct command to run a script with the name MyScript.sh

a)

./MyScript.h

b)

./MyScript.sh

c)

.MyScript.sh

d)

run MyScript.sh

37.

Ahmed is writing a script which will run on bash, what should be the first line in his script.

a)

$#/bin/bash

b)

#!/bin/bash

c)

!#/bin/bash

d)

#!/bash/bash

38.

Arun want to edit the crontab, which command Arun should use to edit the crontab.

a)

cron -e

b)

crontab -e

c)

crontab -l

d)

crontab -r

39.

Arun want to remove the crontab, which command Arun should use to remove the crontab.

a)

crontabb -r

b)

crontab -r

c)

cron -r

d)

cron -l

40.

Arun want to list the crontabs he created, which command Arun should use to list the crontab.

a)

crontab -l

b)

crontab -e

c)

crontab -r

d)

cron -l