wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Coding (Linux) (2 part)

Total questions: 9

Worksheet time: 5mins

Name
Class
Date
1.

Which command will ensure the httpd service (Apache) starts at system boot?

a)

sudo systemctl status httpd.service

b)

sudo systemctl start httpd.service

c)

sudo systemctl enable httpd.service

d)

sudo systemctl init httpd.service

2.

Where would the user named student usually find their personal files?

a)

/student

b)

/var/student

c)

/home/student

d)

/usr/local/student

3.

The logrotate program:

a)

Provides a game where lumberjacks have to roll logs into the river

b)

Erases all logging files on the system

c)

Cyclically rotates and optionally compresses log files to save space

d)

Rotates the text in logfiles so they are hard to read

4.

Which command will list all files under the current directory with a .cfg extension, and then delete them?

a)

find -name "*.cfg" . -exec rm {} ';'

b)

find -exec rm {} ';' -name "*.cfg" .

c)

find . -exec rm {} ';' -name "*.cfg"

d)

find . -name "*.cfg" -exec rm {} ';'

5.

Which command will list all files and directories on the system with cfg in their name?

a)

ls -l $(locate cfg)

b)

locate

c)

locate cfg -exec ls -l {} ';'

d)

find cfg

6.

Which command will find all files and directories in the system whose name ends with cfg?

a)

locate cfg

b)

locate -r "cfg$"

c)

locate -r "^cfg"

d)

locate cfg$

7.

Which command will print out all lines beginning with "X" in all files in the current directory?

a)

grep "^X" *

b)

grep "X$" *

c)

grep $X *

8.

Which command is used to combine three files into a fourth file?

a)

cat file1 > file2 > file3 > file4

b)

cat file1 file2 file3 > file4

c)

cp file1 file2 file3 > file4

d)

cat file1 > file2 > file3 | file4

9.

Which command is used to extract columns from a file to work on them later?

a)

wc

b)

tee

c)

cut

d)

tr