Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Basic Linux Commands for Beginners

Total questions: 16

Worksheet time: 8mins

Name
Class
Date
1.

What command is used to list files in a directory?

a)

ls

b)

dir

c)

show

d)

list

2.

How do you change the current directory in Linux?

a)

Use the 'cd' command followed by the directory path.

b)

Execute 'dir' to list and change directories.

c)

Type 'change dir' followed by the path.

d)

Use the 'mv' command to move directories.

3.

Which command shows the present working directory?

a)

mkdir

b)

pwd

c)

cd

d)

ls

4.

What command would you use to create a new directory?

a)

del

b)

rmdir

c)

mkdir

d)

remove

5.

How can you remove an empty directory in Linux?

a)

Run 'delete ' to remove an empty directory.

b)

Use the command 'rm ' to delete a directory.

c)

Use the command 'rmdir ' to remove an empty directory.

d)

Execute 'rmdir -r ' to remove a directory.

6.

What command displays the contents of a file?

a)

cat

b)

display

c)

show

d)

list

7.

How do you create an empty file in Linux?

a)

create filename.txt

b)

new file filename.txt

c)

touch filename.txt

d)

emptyfile -create

8.

What command lists all files and directories, including hidden ones?

a)

list -a

b)

dir

c)

ls -a

d)

ls -l

9.

Which command would you use to go back to the previous directory?

a)

cd /

b)

cd .

c)

cd ..

d)

cd ~

10.

How can you check the current directory you are in?

a)

Use 'ls' in Windows Command Prompt.

b)

Check the properties of the folder.

c)

Use 'pwd' in Unix/Linux or 'cd' in Windows Command Prompt.

d)

Type 'current' in Unix/Linux.

11.

What command would you use to create multiple directories (dir1 dir2 dir3) at once?

a)

mkdir all dir1 dir2 dir3

b)

mkdir dir1 dir2 dir3

c)

create dir1 dir2 dir3

d)

mkdir dir1; mkdir dir2; mkdir dir3

12.

How do you delete a directory that is not empty?

a)

Use 'rmdir ' in the terminal.

b)

Use 'rm -r ' in the terminal.

c)

Use 'rm ' in the terminal.

d)

Delete the directory from the file explorer.

13.

How do you rename a file in Linux?

a)

Rename the file by editing its properties in the GUI.

b)

Use the 'rm' command followed by 'touch' to create a new file with the desired name.

c)

Use the 'mv' command to rename a file.

d)

Use the 'cp' command to rename a file.

14.

What command would you use to copy a file?

a)

mv source_file destination_file

b)

cp source_file destination_path

c)

rm source_file destination_file

d)

touch source_file destination_file

15.

How can you move a file to a different directory?

a)

Use the 'cp' command to copy the file instead.

b)

Drag and drop the file in the file explorer.

c)

Rename the file to move it to a different directory.

d)

Use the 'mv' command followed by the source file path and the destination directory path.

16.

How do you create a directory and navigate into it in one command?

a)

mkdir new_directory && cd new_directory

b)

cd new_directory new_directory

c)

mkdir new_directory | cd new_directory

d)

mkdir new_directory; cd new_directory