wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Command Line Practice

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Lists files and directories in long format, showing permissions, size, and date.

a)

ls -l

b)

dir -long

c)

list -details

d)

show -files

2.

Moves or renames files or directories.

a)

cp

b)

mv

c)

rm

d)

ls

3.

Moves up one directory level.

a)

cd ..

b)

cd /

c)

cd .

d)

cd ~

4.

Terminates a process by its process ID (PID).

a)

kill

b)

terminate

c)

end

d)

stop

5.

Removes a directory and its parent if empty.

a)

rmdir -p

b)

rm -r

c)

delete

d)

rmdir

6.

Silent mode; suppresses output.

a)

-s

b)

--silent

c)

-o

d)

--quiet

7.

Recursively removes a directory and its contents.

a)

rm -r

b)

rmdir

c)

rm -f

d)

delete

8.

Displays the contents of a file with line numbers.

a)

cat -n

b)

cat

c)

less

d)

more

9.

Quiet mode; suppresses warnings and errors.

a)

-q

b)

--quiet

c)

-silent

d)

-no-warn

10.

Displays detailed information about files.

a)

-l

b)

-a

c)

-h

d)

-r

11.

Inverts the match, showing lines that do not match the pattern.

a)

-v

b)

-i

c)

-e

d)

-c

12.

Changes the owner and group of a file or directory.

a)

chmod :

b)

chown :

c)

chgrp

d)

mv

13.

Moves or renames files, prompting before overwriting.

a)

mv -i

b)

cp -i

c)

rm -i

d)

mv

14.

Creates a directory and any necessary parent directories.

a)

mkdir -p

b)

rmdir

c)

touch

d)

cp

15.

Lists files and directories in the current directory.

a)

ls

b)

dir

c)

list

d)

show

16.

Searches for a specific pattern in a file and displays matching lines.

a)

grep

b)

find

c)

search

d)

locate

17.

Downloads files from the web.

a)

curl

b)

wget

c)

ftp

d)

scp

18.

Tests connectivity to a specified host.

a)

ping

b)

connect

c)

test

d)

check

19.

Displays help information for the command.

a)

-h

b)

--help

c)

/help

d)

?

20.

Displays line numbers in output.

a)

-n

b)

-l

c)

-a

d)

-e