0
0
Linux CLIscripting~20 mins

Opening and using the terminal in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Terminal Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:00remaining
What is the output of the command pwd?
You open a terminal and run the command pwd. What does it show?
Linux CLI
pwd
A/home/username
BList of files in the current directory
CShows the current date and time
DAn error message saying command not found
Attempts:
2 left
💡 Hint
Think about what 'pwd' stands for and what it tells you.
💻 Command Output
intermediate
1:00remaining
What happens when you run ls -l in the terminal?
You type ls -l and press Enter. What output do you expect?
Linux CLI
ls -l
AAn error saying invalid option
BOnly the names of files and directories without details
CThe current directory path
DA detailed list of files and directories with permissions, owner, size, and date
Attempts:
2 left
💡 Hint
The -l option means 'long format'.
📝 Syntax
advanced
1:00remaining
Which command correctly changes directory to the parent folder?
You want to move one folder up from your current location. Which command is correct?
Acd /
Bcd ..
Ccd .
Dcd ../..
Attempts:
2 left
💡 Hint
The parent folder is one level above the current folder.
💻 Command Output
advanced
1:00remaining
What error appears if you try to run cd nonexistent_folder?
You type cd nonexistent_folder where the folder does not exist. What is the output?
Linux CLI
cd nonexistent_folder
Abash: cd: nonexistent_folder: No such file or directory
BMoved to nonexistent_folder
CPermission denied
DCommand not found
Attempts:
2 left
💡 Hint
Think about what happens when you try to enter a folder that does not exist.
🚀 Application
expert
1:30remaining
How many files and directories are listed by ls -a in a folder with 3 visible files and 2 hidden files?
You have 3 normal files and 2 hidden files (names start with a dot) in a folder. What is the total number of items shown by ls -a?
Linux CLI
ls -a
A5
B6
C7
D3
Attempts:
2 left
💡 Hint
Remember that ls -a also shows '.' and '..' entries.