Font size
WorksheetsU01 - Command Line & Binary/Decimal Test
Total questions: 20
Worksheet time: 15mins
The action of the command pwd is to ...
Display the current user's password
Display a list of user passwords
Display the current working directory
Display the power usage report for the server
How do you create a new folder called "Flower"?
touch Flower
mkdir Flower
rmdir Flower
cd Flower
How do you list all the files that are in the current folder?
list all
pwd
cd
ls
Currently the user is in the following folder: /home/jfletcher/Downloads/newFile. After executing cd ../.. where is the user now?
/home/jfletcher
/home/jfletcher/Downloads
/home
/home/jfletcher/Downloads/newFile
What is the difference between rm and rm -rf?
rm removes a directory while rm- rf removes a file
There is no difference, they both remove files and directories
rm can remove a file while rm -rf removes a directory
rm removes files and folders while rm -rf gives you details on the removal
What is a directory?
A folder used to store files
A file
A command to a computer
A file used to store folders
touch media/popular.txt
It changes the working directory to the media directory.
It creates a file named popular.txt in the media directory.
It creates a file named popular.txt in your working directory.
This command is not formed correctly.
What command allows you to list files sorted by when they were last modified?
ls -a
ls -t
ls -l
ls
Quiz: Viewing and Changing the File System
What command moves all files in the current directory to the directory school/?
mv * school/
mv school -a
mv school
mv -a school/
What is the purpose of an option (like -t or -a)?
To make a command optional.
To modify the behavior of a command.
To change the color of command output.
To reverse a command.
What command could you use to copy the contents of thisfile.txt to a new file called thatfile.txt?
cp thisfile.txt thatfile.txt
cp thatfile.txt thisfile.txt
cp thisfile.txt
cp thatfile.txt
What does the < symbol do?
Append command to file
Redirect input to a command
Output commands
It both redirects input to a command and outputs commands
Which command below, searches the file greatest.txt for “LeBron”, then send the results to the file goat.txt.
grep "LeBron" greatest.txt >> goat.txt
grep "LeBron" goat.txt
grep "LeBron" greatest.txt cat goat.tx
grep "LeBron" greatest.txt | goat.txt
What commands would sort the contents of the file greatest.txt and print them?
None of these
cat greatest.txt >> sort
cat greatest.txt | sort
echo greatest.txt > sort
How would you activate changes you made to your bash profile?
source ~/.bash_profile
nano ~/.bash_profile
echo ~/.bash_profile
touch ~/.bash_profile
The command nano hello.txt ____
Opens the bash profile in the nano text editor.
Moves hello.txt to a directory called nano.
Clears the contents of hello.txt.
Opens hello.txt in the nano text editor
To make it so when you type la, the ls -a command will run you must ___
nano la
Enter alias ls -a="la" in your bash profile
Enter alias la="ls -a" in your bash profile
Type ls -a = la into the terminal
Convert the following binary number to decimal.
11011011
Convert the following decimal number to bniary.
116
Order the following from least to greatest:
* Binary 1011
* Decimal 12
* Decimal 5
* Binary 1101
Decimal 5, Binary 1011, Decimal 12, Binary 1101
Decimal 5, Decimal 12, Binary 1011, Binary 1101
Decimal 5, Binary 1101, Decimal 12, Binary 1011
Binary 1101, Decimal 12, Binary 1011, Decimal 5
