wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Linux-1 Week 4

Total questions: 15

Worksheet time: 8mins

Name
Class
Date
1.

What can be done with the 'Shebang'

a)

It's a command for on the prompt

b)

Shutdown your Linux System

c)

Controles the command interpreter in a script

d)

End a bash script

2.

What is the difference between Archiving and Compression

a)

There is no difference

b)

Archiving: Combines multiple files into one

c)

Compression: Compression: Makes the files smaller

d)

Archiving: Makes the files smaller

e)

Compression: Combines multiple files into one

3.

What is the most used compression-command in Linux

a)

7zip

b)

tar

c)

gzip

d)

zip

4.

How to unzip (decompress) a file in Linux

a)

decomp <filename>

b)

gzip -d <filename>

c)

gunzip <filename>

d)

uncomp <filename>

5.

What command to use to create an archive

a)

arch

b)

zip

c)

pack

d)

tar

6.

How to create a tar-ball name 'archive.tar' will all files with extention '.txt' (assuming that they exist)

a)

tar -xvf *.txt archive.tar

b)

tar -cvf archive.tar *.txt

c)

tar *.txt archive.tar

d)

tar -f archive.tar *.txt

7.

Which of the following commands are pager-commands?

a)

head

b)

less

c)

more

d)

cat

8.

How to search for a text string using the 'more-pager command'

a)

That is not possible, use less

b)

use '/'

c)

use 'f'

d)

use '!'

9.

Correct command to display the last 25 lines of a file called 'textfile.txt'

a)

last -25 textfile.txt

b)

end -25 textfile.txt

c)

tail -25 textfile.txt

d)

cat -25 textfile.txt

10.

What can be done with the pipe (|) command?

a)

run a second command only if the first one failed

b)

run a second command only if the first command was succesfull

c)

set an exit-code

d)

send the output of one command to another

11.

How to redirect the output from a cat-command to a file 'testfile.txt'

a)

cat 'filename' > testfile.txt

b)

cat 'filename' | testfile.txt

c)

cat 'filename' < testfile.txt

d)

cat 'filename' || testfile.txt

12.

How to append STDERR to a file

a)

using 2>>

b)

using >>

c)

using 2>

d)

using >

13.

How to display the first, fifth, sixth and seventh fields from mypasswd database file?

a)

cut : [f1,5-7] mypasswd

b)

cut : [1,5-7] mypasswd

c)

cut -d: -f1,5-7 mypasswd

d)

cut -f mypasswd : f1,5-7

14.

What must be done before a script can be executed?

a)

Make the file executable using chmod u+x

b)

Add the shebang in the first line of the script

c)

Place the script in an executable-scripts directory like /bin

d)

Compile the script

15.

How to execute a command inside a script

a)

use normal single quotes (') around the command

b)

use double quotes (') around the command

c)

use brackets ([ ]) around the command

d)

use backtick quotes(`) around the command