0
0
Linux CLIscripting~5 mins

ls options (-l, -a, -h, -R) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the -l option do in the ls command?
The -l option shows a detailed list of files and directories. It includes permissions, number of links, owner, group, size, and modification date.
Click to reveal answer
beginner
What is the purpose of the -a option in ls?
The -a option shows all files, including hidden files that start with a dot (.), which are normally not shown.
Click to reveal answer
beginner
Explain what the -h option does when used with ls -l.
The -h option makes file sizes easier to read by showing them in human-friendly units like KB, MB, or GB instead of bytes.
Click to reveal answer
intermediate
What does the -R option do in the ls command?
The -R option lists directories and their contents recursively, showing all files and folders inside subdirectories.
Click to reveal answer
intermediate
How would you combine ls options to see all files with detailed info and human-readable sizes?
Use ls -lah. This shows all files including hidden ones (-a), detailed info (-l), and human-readable sizes (-h).
Click to reveal answer
Which ls option shows hidden files?
A-l
B-h
C-a
D-R
What does ls -lh display?
AList files with permissions only
BList only hidden files
CList files recursively
DList files with detailed info and human-readable sizes
Which option lists directory contents recursively?
A-R
B-h
C-l
D-a
What information does ls -l NOT show?
AFile content
BFile size
CFile owner
DFile permissions
How do you show all files including hidden ones with detailed info?
Als -a
Bls -la
Cls -l
Dls -h
Describe what each of these ls options does: -l, -a, -h, and -R.
Think about what you want to see: details, hidden files, easy sizes, or all folders inside folders.
You got /4 concepts.
    How would you use ls options to list all files including hidden ones, with sizes easy to read, and detailed info?
    Combine the options that show details, hidden files, and human-friendly sizes.
    You got /4 concepts.