0
0
Linux CLIscripting~5 mins

ls (list files and directories) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the ls command do in Linux?
The ls command lists files and directories in the current folder or a specified path.
Click to reveal answer
beginner
How do you list all files, including hidden ones, using ls?
Use ls -a to show all files, including those starting with a dot (hidden files).
Click to reveal answer
beginner
What does the -l option do with ls?
The -l option shows a detailed list with permissions, owner, size, and modification date.
Click to reveal answer
intermediate
How can you list files sorted by modification time using ls?
Use ls -lt to list files sorted by modification time, newest first.
Click to reveal answer
intermediate
What does ls -R do?
The -R option lists directories and their contents recursively, showing all nested files and folders.
Click to reveal answer
Which ls option shows hidden files?
A-R
B-l
C-t
D-a
What does ls -l display?
ADetailed info like permissions and size
BHidden files only
CFiles sorted by size
DOnly file names
How do you list files sorted by modification time, newest first?
Als -R
Bls -lt
Cls -a
Dls -lh
Which command lists all files and directories inside subfolders too?
Als -R
Bls -a
Cls -l
Dls -t
What does the plain ls command show by default?
AAll files including hidden
BOnly directories
CFiles and directories except hidden files
DDetailed file info
Explain how to use ls to see detailed info about all files, including hidden ones.
Combine options to get detailed and hidden files listed.
You got /5 concepts.
    Describe how to list files recursively in all subdirectories using ls.
    Think about how to see inside folders inside folders.
    You got /4 concepts.