wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

LINUX MODULE 03 QUIZ

Total questions: 10

Worksheet time: 3mins

Name
Class
Date
1.

What is a shell in Linux?

a)

Hardware interface

b)

Software kernel

c)

Command interpreter

d)

Text editor

2.

Which of the following is the default shell in most Linux distributions?

a)

Bourne Again Shell (bash)

b)

C shell (csh)

c)

Bourne shell (sh)

d)

Korn shell (ksh)

3.

Which of the following is the correct syntax for an if statement in bash?

a)

if [ condition ]; then

b)

if condition: then

c)

if (condition); then

d)

if {condition}; then

4.

Which of the following symbol is used to comment a line in shell scripts?

a)

//

b)

/* */

c)

#

d)

%%

5.

What file extension is typically used for shell scripts?

a)

.sh

b)

.bash

c)

.txt

d)

.shell

6.

What will the following script output?

i=5

while [ $i -gt 0 ]; do

echo $i

i=$((i-1))

done

a)

5 4 3 2 1

b)

1 2 3 4 5

c)

Infinite loop

d)

Error in syntax

7.

How do you access the first argument passed to a shell script?

a)

$arg1

b)

$1

c)

$first

d)

$0

8.

Which of the following is a scripting language for shell programming?

a)

Python

b)

Bash

c)

Java

d)

HTML

9.

What does ksh stand for?

a)

Korn Shell

b)

Kernel Shell

c)

Key Shell

d)

Kermit Shell

10.

What does the command echo $0 display in a script?

a)

The current shell

b)

The name of the script

c)

The first argument passed

d)

The last command executed