wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Basic Linux Practice

Total questions: 23

Worksheet time: 5mins

Name
Class
Date
1.

Change to your home directory

(a)  

2.

Which always changes to your last working directory?

a)

cd ~

b)

cd /last

c)

cd ..

d)

cd -

3.

What does cd ..cd\ .. do?

a)

Error

b)

Change to the home directory

c)

Change to the parent directory

d)

Change to the last working directory

4.

List contents of your current directory

(a)  

5.

Display contents of a file hello.txthello.txt

(a)  

6.

Create empty directory myStuffmyStuff

(a)  

7.

Which of these lists the contents of a directory and all subdirectories?

a)

ls -l

b)

ls

c)

ls -R

d)

ls -a

8.

List contents of all directories and subdirectories, and show hidden files

(a)  

9.

What command is used to display the current working directory?

a)

pwd

b)

cd

c)

ls

d)

dir

10.

Which are uses of the command touch? (select all that apply)

a)

Create an empty file

b)

Create an empty directory

c)

Update the timestamp of a file

d)

View the contents of a file

11.

Which are uses of the command mv? (select all that apply)

a)

Rename a file

b)

Move a file into a directory

c)

Copy a file

d)

Rename directory

12.

cp fileA fileB: If fileB already exists, what happens?

a)

Error message

b)

Two files named fileB

c)

The copy gets named fileB(1)

d)

fileB gets overwritten with the copy

13.

Which of these commands can delete a non-empty directory

a)

rm

b)

rmdir

c)

mkdir

d)

None of these

14.

Which command produced this output: essay.txt: ASCII text

a)

touch essay.txt

b)

file essay.txt

c)

ls -l essay.txt

d)

cat essay.txt

15.

What is gpg used for?

a)

Encryption

b)

Viewing files

c)

Managing directory structure

d)

Networking

16.

Which command is used to find files by name?

a)

grep

b)

find

c)

locate

d)

search

17.

What does the 'grep' command do?

a)

Encrypts / decrypts files

b)

Searches text using patterns

c)

Changes file permissions

d)

Displays the current working directory

18.

Which of the following is not a Linux file permission?

a)

Read

b)

Create

c)

Execute

d)

Write

19.

Which of the following commands allows for moving one level up in Linux directory tree?

a)

cd -

b)

cd ..

c)

cd /

d)

cd ~

20.

Which of the following key combinations allows to terminate the current process in Linux shell?

a)

Ctrl + C

b)

Ctrl + A

c)

Ctrl + E

d)

Ctrl + L

21.

The output of whoami is a:

a)

string

b)

file

c)

directory

d)

username

22.

Which operator makes a command run in the background?

a)

&

b)

>

c)

&&

d)

>>

23.

Which command is used to display the manual of other commands?

a)

man

b)

help

c)

info

d)

doc