wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

CSE105 QUIZ01

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What is a shell script?

a)

group of commands

b)

a file containing special symbols

c)

a file containing a series of commands, written to perform certain task(s).

d)

group of functions

2.

Shell scripts need to be saved with an extension .sh.

a)

True

b)

False

3.

The first line in any shell script begins with a _____

a)

&

b)

!

c)

$

d)

#

4.

To run the script, we should make it executable first by using _____

a)

chmod +x

b)

chmod +r

c)

chmod +w

d)

chmod +rwx

5.

Which command is used for making the scripts interactive?

a)

grep

b)

input

c)

read

d)

write

6.

The first argument is read by the shell into the parameter ___

a)

1$

b)

$3

c)

$$

d)

$1

7.

The complete set of positional parameters is stored in ______ as a single string.

a)

$n

b)

$#

c)

$*

d)

$$

8.

Which of the following is used for storing the number of positional parameters?

a)

$*

b)

$2

c)

$#

d)

$n

9.

Which symbol will be used with grep command to match the pattern pat at the beginning of a line?

a)

^pat

b)

$pat

c)

pat$

d)

pat^

10.

Which command is used to sort the lines of data in a file in reverse order

a)

sort

b)

sh

c)

st

d)

sort -r

11.

Which command is used to display the top of the file?

a)

cat

b)

head

c)

more

d)

grep

12.

Which command is used to copy all files having the string chap and any two characters after that to the progs directory?

a)

cp chap?? progs

b)

cp chap* progs

c)

cp chap[12] /progs/*.*

d)

cp chap?? /progs/*

e)

None of the above

13.

Which command is used to remove a directory?

a)

remove

b)

rmdir

c)

dldir

d)

rdir

14.

Which command is used to extract specific columns from the file?

a)

cat

b)

cut

c)

grep

d)

paste

15.

Which command sends the word count of the file infile to the newfile.

a)

wc infile >newfile

b)

wc <infile >newfile

c)

wc infile - newfile

d)

wc infile | newfile