WorksheetsLinux 1 -- Commands -- Chapter 1 & 2
Total questions: 14
Worksheet time: 14mins
Match the command to the correct description.
display a message
echo
erase the terminal
clear
display the current logged in user
whoami
display previously entered commands
history
display information about a command
type
Which of the following is a command built into the shell?
internal
external
current
present
Which directories do external commands typically reside in? (choose 3)
/bin
/usr/bin
/usr/local/bin
/etc/passwd
/home
Which command will provide a list of options for the ls command?
ls --help
ls -help
ls -?
ls --?
Match the command to the correct description.
list of directories
ls
list of directories with detailed information
ls -l
list of diretories including hidden files
ls -a
list of directories in reverse order
ls -r
pwd
current directory
Match the command to the correct description.
moves up one level
cd . .
switch to the home directory of the current user
cd ~
switch between the current and the previous directory
cd -
creates a directory
mkdir
deletes an empty directory
rmdir
Match the command to the correct description.
creates an empty file or updates the timestamp on a current file
touch
moves or renames files or directories
mv
copies a single file or directory to another location
cp
removes a directory and its contents
rm -r
deletes a file
rm
Displays the content of a file.
cat
touch
ls
type
Match each part of this path to the correct description.
/home/student/Science
represents the root directory
/
directory under the root directory
home
directory within the home directory
student
subdirectory within the student directory
Science
An "absolute" path starts at the highest level of the file system hierarchy.
Choose 2 answers that apply to this statement.
/
root
cat
ls
cd -
Which command provides detailed information about the ls command?
man ls
cat ls
touch ls
mkdir ls
Match the description to the correct use of the calendar command.
Shows the current month along with the next 2 months.
cal -A 2
Shows the current month along with the previous 2 months.
cal -B 2
Displays the entire calendar for the current year.
cal -y
Shows the calendar for December of 2025.
cal 12 2025
Shows the current month's calendar.
cal
Which is the correct description of the alias command?
to make a command shorter or more descriptive
can use to for command completion
used as a text editor within Bash
to view the contents of a file in ASCII format
What file must you edit to create persistent aliases?
.bashrc
.selected_editor
.profile
.bashetc
