wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Command Line and Git KBA

Total questions: 19

Worksheet time: 14mins

Name
Class
Date
1.

The command "pwd" stands for:

a)

Print Working Directory

b)

Present Working Directory

c)

Proven Working Directory

d)

Program Working Directory

2.

When a file, directory, or program is passed into a command, it is called a(n);

a)

Terminal

b)

Argument

c)

Option

d)

Element

3.

Fill in the blanks.

The ___ command creates a new folder in the working directory and the ___ command creates a new file in the working directory.

a)

touch, mkdir

b)

mkdir, touch

c)

cd, ls

d)

ls, cd

4.

This is a text interface for the computer's operating system, accessed via the terminal.

a)

Command Line

b)

File System

c)

Root Directory

d)

Git

5.

This command lists all contents of a directory, including hidden files and directories.

a)

ls -a

b)

ls

c)

ls -l

d)

ls -t

6.

Which commands outputs the contents of a specified file?

a)

ls

b)

pwd

c)

cat

d)

rm

7.

True or False. Multiple options can be used together. Ex. ls -alt

a)

True

b)

False

8.

The ___ command deletes a file, and if that file is a directory will also delete all the files within it.

a)

rm

b)

delete

c)

delete -a

d)

rm -r

9.

What is this command doing cat my-file.txt | sort > new-file.txt

a)

Takes the standard output from cat new-file.txt and reverses the contents of new-file.txt

b)

Takes the standard output from cat new-file.txt and pipes it to my-file.txt

c)

Takes the standard output from cat my-file and pipes it to sort, then redirects the final output to new-file.txt

d)

Takes the standard output from cat my-file and reverses the contents of new-file.txt

10.

This command searches for lines in files that match a patter, and then returns the results.

a)

sed

b)

grep

c)

find

d)

search

11.

This is where environment settings can be stored.

a)

~/.bash_profile

b)

~/.bash_history

c)

~/.bash_environment

d)

~/.bash_settings

12.

This git command adds files from the working directory to the staging area.

a)

git push

b)

git add

c)

git commit

d)

git pull

13.

This git command records changes to the repository.

a)

git commit

b)

git push

c)

git add

d)

git pull

14.

This command resets to a previous commit in the commit history.

a)

git reset HEAD filename

b)

git checkout HEAD filename

c)

git reset commit_SHA

d)

git reset checkout pull

15.

This command is used to switch from one branch to another.

a)

git branch -d branch_name

b)

git branch branch_name

c)

git branch

d)

git checkout branch_name

16.

True or False. The command 'git clone' creates a remote copy of a local file.

a)

True

b)

False

17.

What git command would you use to update the remote repository with the changes from the local branch 'first-branch'? 

a)

git pull origin main

b)

git push origin first-branch

c)

git clone repo_url

d)

git fetch origin first-branch

18.

What is a remote?

a)

A git repository that lives outside of your git project folder.

b)

An electronic device used to operate another device from a distance

c)

A git repository that lives inside your git project folder

d)

A work from home job

19.

What is GitHub?

a)

Git repository hosting service that allows for project collaboration among software developers.

b)

An open source software that allows you to keep track of changes made to a project over time.

c)

a text interface for the computer’s operating system