0
0
Linux CLIscripting~20 mins

ls options (-l, -a, -h, -R) in Linux CLI - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
ls Options Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What does ls -l display?
You run the command ls -l in a directory. What kind of information will you see in the output?
AA detailed list showing file permissions, number of links, owner, group, size, and modification date for each file.
BA list of all files including hidden ones, but without details.
CA recursive list of all files in the directory and its subdirectories.
DA list showing file sizes in human-readable format without other details.
Attempts:
2 left
💡 Hint
Think about what the long format option means for file details.
💻 Command Output
intermediate
2:00remaining
What is the effect of ls -a?
You run ls -a in a directory. What will the output include?
AOnly visible files and directories, excluding hidden ones.
BA recursive list of files in the current directory and all subdirectories.
CA detailed list of files with sizes in human-readable format.
DAll files including hidden files that start with a dot (.), but without detailed info.
Attempts:
2 left
💡 Hint
Hidden files in Linux start with a dot.
💻 Command Output
advanced
2:00remaining
What does ls -h do when combined with -l?
You run ls -lh. What difference does the -h option make in the output?
AIt hides hidden files from the list.
BIt shows file sizes in a human-readable format like KB, MB, or GB.
CIt shows file sizes in bytes only.
DIt lists files recursively in all subdirectories.
Attempts:
2 left
💡 Hint
Think about how humans prefer to read file sizes.
💻 Command Output
advanced
2:00remaining
What is the output of ls -R?
You run ls -R in a directory. What will the output show?
AA detailed list of files with sizes in human-readable format.
BAll files including hidden ones in the current directory.
CA recursive listing of all files in the current directory and all its subdirectories.
DOnly files in the current directory without details.
Attempts:
2 left
💡 Hint
The -R option means recursive.
🧠 Conceptual
expert
3:00remaining
Which ls command combination shows all files recursively with human-readable sizes and detailed info?
You want to see every file including hidden ones, in all subdirectories, with detailed info and sizes easy to read. Which command should you use?
Als -Ralh
Bls -hRal
Cls -lRa
Dls -laRh
Attempts:
2 left
💡 Hint
Order of options usually does not matter, but some combinations may cause errors or unexpected output.