0
0
Linux CLIscripting~15 mins

ls options (-l, -a, -h, -R) in Linux CLI - Mini Project: Build & Apply

Choose your learning style9 modes available
Explore the ls Command Options
📖 Scenario: You are organizing files on your computer. You want to learn how to use the ls command with different options to see file details, hidden files, human-readable sizes, and contents of folders recursively.
🎯 Goal: Learn how to use the ls command with options -l, -a, -h, and -R to list files in different useful ways.
📋 What You'll Learn
Use the ls command with option -l to list files with details
Use the ls command with option -a to show hidden files
Use the ls command with option -h to show file sizes in human-readable format
Use the ls command with option -R to list directories recursively
💡 Why This Matters
🌍 Real World
Knowing how to list files with details, hidden files, and folder contents helps you manage and organize your computer files easily.
💼 Career
Many IT and developer jobs require using command line tools like <code>ls</code> to navigate and inspect files quickly.
Progress0 / 4 steps
1
List files with details using ls -l
Type the command ls -l to list all files and folders in the current directory with detailed information like permissions, owner, size, and modification date.
Linux CLI
Need a hint?

Use ls -l to see details like file size and permissions.

2
Show hidden files using ls -a
Add the option -a to the ls command to show hidden files (those starting with a dot). Type ls -a to see all files including hidden ones.
Linux CLI
Need a hint?

Hidden files start with a dot. Use ls -a to see them.

3
Show human-readable file sizes using ls -lh
Combine options -l and -h to list files with details and human-readable sizes. Type ls -lh to see sizes like KB, MB instead of bytes.
Linux CLI
Need a hint?

Use -h with -l to make sizes easy to read.

4
List directories recursively using ls -R
Use the option -R with ls to list all files and folders inside the current directory and all its subdirectories. Type ls -R to see the full folder tree.
Linux CLI
Need a hint?

Use ls -R to see all files in folders and subfolders.