NEW
Font size
WorksheetsCommand Line and Git KBA
Total questions: 19
Worksheet time: 14mins
The command "pwd" stands for:
Print Working Directory
Present Working Directory
Proven Working Directory
Program Working Directory
When a file, directory, or program is passed into a command, it is called a(n);
Terminal
Argument
Option
Element
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.
touch, mkdir
mkdir, touch
cd, ls
ls, cd
This is a text interface for the computer's operating system, accessed via the terminal.
Command Line
File System
Root Directory
Git
This command lists all contents of a directory, including hidden files and directories.
ls -a
ls
ls -l
ls -t
Which commands outputs the contents of a specified file?
ls
pwd
cat
rm
True or False. Multiple options can be used together. Ex. ls -alt
True
False
The ___ command deletes a file, and if that file is a directory will also delete all the files within it.
rm
delete
delete -a
rm -r
What is this command doing cat my-file.txt | sort > new-file.txt
Takes the standard output from cat new-file.txt and reverses the contents of new-file.txt
Takes the standard output from cat new-file.txt and pipes it to my-file.txt
Takes the standard output from cat my-file and pipes it to sort, then redirects the final output to new-file.txt
Takes the standard output from cat my-file and reverses the contents of new-file.txt
This command searches for lines in files that match a patter, and then returns the results.
sed
grep
find
search
This is where environment settings can be stored.
~/.bash_profile
~/.bash_history
~/.bash_environment
~/.bash_settings
This git command adds files from the working directory to the staging area.
git push
git add
git commit
git pull
This git command records changes to the repository.
git commit
git push
git add
git pull
This command resets to a previous commit in the commit history.
git reset HEAD filename
git checkout HEAD filename
git reset commit_SHA
git reset checkout pull
This command is used to switch from one branch to another.
git branch -d branch_name
git branch branch_name
git branch
git checkout branch_name
True or False. The command 'git clone' creates a remote copy of a local file.
True
False
What git command would you use to update the remote repository with the changes from the local branch 'first-branch'?
git pull origin main
git push origin first-branch
git clone repo_url
git fetch origin first-branch
What is a remote?
A git repository that lives outside of your git project folder.
An electronic device used to operate another device from a distance
A git repository that lives inside your git project folder
A work from home job
What is GitHub?
Git repository hosting service that allows for project collaboration among software developers.
An open source software that allows you to keep track of changes made to a project over time.
a text interface for the computer’s operating system
