Challenge - 5 Problems
Linux Command Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
What is the output of the
ls command?You run the
ls command in a directory containing three files: file1.txt, file2.txt, and script.sh. What will the command output?Linux CLI
ls
Attempts:
2 left
💡 Hint
The
ls command lists files separated by spaces in multi-column format by default.✗ Incorrect
The
ls command outputs the file names separated by spaces on a single line by default (for short names that fit), so the output will be file1.txt file2.txt script.sh.💻 Command Output
intermediate2:00remaining
What does the
pwd command output?You are currently inside the directory
/home/user/documents. What will the pwd command output?Linux CLI
pwd
Attempts:
2 left
💡 Hint
The
pwd command shows the full path of the current directory.✗ Incorrect
The
pwd command prints the full absolute path of the current working directory, which is /home/user/documents.💻 Command Output
advanced2:00remaining
What is the output of the
echo $HOME command?Assuming your home directory is
/home/alex, what will the command echo $HOME output?Linux CLI
echo $HOME
Attempts:
2 left
💡 Hint
The
$HOME variable stores the path to your home directory.✗ Incorrect
The shell replaces
$HOME with the path of the home directory, so the output is /home/alex.💻 Command Output
advanced2:00remaining
What error does this command produce?
You run the command
cd /nonexistentfolder. What error message will you see?Linux CLI
cd /nonexistentfolder
Attempts:
2 left
💡 Hint
The folder does not exist, so
cd cannot change to it.✗ Incorrect
The shell reports that the directory does not exist with the message:
bash: cd: /nonexistentfolder: No such file or directory.💻 Command Output
expert3:00remaining
How many files are listed by this command?
You run
ls -l | grep '^-' | wc -l in a directory. What does this command count?Linux CLI
ls -l | grep '^-' | wc -lAttempts:
2 left
💡 Hint
The
ls -l output starts lines with - for files and d for directories.✗ Incorrect
The command lists files in long format, filters lines starting with
- (regular files), then counts those lines. So it counts regular files only.