wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

U01 - Command Line & Binary/Decimal Test

Total questions: 20

Worksheet time: 15mins

Name
Class
Date
1.

The action of the command pwd is to ...

a)

Display the current user's password

b)

Display a list of user passwords

c)

Display the current working directory

d)

Display the power usage report for the server

2.

How do you create a new folder called "Flower"?

a)

touch Flower

b)

mkdir Flower

c)

rmdir Flower

d)

cd Flower

3.

How do you list all the files that are in the current folder?

a)

list all

b)

pwd

c)

cd

d)

ls

4.

Currently the user is in the following folder:  /home/jfletcher/Downloads/newFile. After executing cd ../.. where is the user now?

a)

/home/jfletcher

b)

/home/jfletcher/Downloads

c)

/home

d)

/home/jfletcher/Downloads/newFile

5.

What is the difference between rm and rm -rf?

a)

rm removes a directory while rm- rf removes a file

b)

There is no difference, they both remove files and directories

c)

rm can remove a file while rm -rf removes a directory

d)

rm removes files and folders while rm -rf gives you details on the removal

6.

What is a directory?

a)

A folder used to store files

b)

A file

c)

A command to a computer

d)

A file used to store folders

7.

touch media/popular.txt

a)

It changes the working directory to the media directory.

b)

It creates a file named popular.txt in the media directory.

c)

It creates a file named popular.txt in your working directory.

d)

This command is not formed correctly.

8.

What command allows you to list files sorted by when they were last modified?

a)

ls -a

b)

ls -t

c)

ls -l

d)

ls

9.

Quiz: Viewing and Changing the File System

What command moves all files in the current directory to the directory school/?

a)

mv * school/

b)

mv school -a

c)

mv school

d)

mv -a school/

10.

What is the purpose of an option (like -t or -a)?

a)

To make a command optional.

b)

To modify the behavior of a command.

c)

To change the color of command output.

d)

To reverse a command.

11.

What command could you use to copy the contents of thisfile.txt to a new file called thatfile.txt?

a)

cp thisfile.txt thatfile.txt

b)

cp thatfile.txt thisfile.txt

c)

cp thisfile.txt

d)

cp thatfile.txt

12.

What does the < symbol do?

a)

Append command to file

b)

Redirect input to a command

c)

Output commands

d)

It both redirects input to a command and outputs commands

13.

Which command below, searches the file greatest.txt for “LeBron”, then send the results to the file goat.txt.

a)

grep "LeBron" greatest.txt >> goat.txt

b)

grep "LeBron" goat.txt

c)

grep "LeBron" greatest.txt cat goat.tx

d)

grep "LeBron" greatest.txt | goat.txt

14.

What commands would sort the contents of the file greatest.txt and print them?

a)

None of these

b)

cat greatest.txt >> sort

c)

cat greatest.txt | sort

d)

echo greatest.txt > sort

15.

How would you activate changes you made to your bash profile?

a)

source ~/.bash_profile

b)

nano ~/.bash_profile

c)

echo ~/.bash_profile

d)

touch ~/.bash_profile

16.

The command nano hello.txt ____

a)

Opens the bash profile in the nano text editor.

b)

Moves hello.txt to a directory called nano.

c)

Clears the contents of hello.txt.

d)

Opens hello.txt in the nano text editor

17.

To make it so when you type la, the ls -a command will run you must ___

a)

nano la

b)

Enter alias ls -a="la" in your bash profile

c)

Enter alias la="ls -a" in your bash profile

d)

Type ls -a = la into the terminal

18.

Convert the following binary number to decimal.

11011011

4 lines
19.

Convert the following decimal number to bniary.

116

4 lines
20.

Order the following from least to greatest:

* Binary 1011

* Decimal 12

* Decimal 5

* Binary 1101

a)

Decimal 5, Binary 1011, Decimal 12, Binary 1101

b)

Decimal 5, Decimal 12, Binary 1011, Binary 1101

c)

Decimal 5, Binary 1101, Decimal 12, Binary 1011

d)

Binary 1101, Decimal 12, Binary 1011, Decimal 5