ls
Quick Reference
Command Name:
ls
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
List files
View files and directories in the current location
- 2
Show hidden files
Display all files including hidden ones
- 3
File permissions
Check permissions and ownership of files
- 4
Sort by size
List files ordered by size
Syntax
ls [OPTION]... [FILE]...
Options
Option | Description |
---|---|
-l |
Use a long listing format |
-a |
Show hidden entries starting with . |
-h |
Human-readable sizes |
-R |
List subdirectories recursively |
Examples
How to Use These Examples
The examples below show common ways to use the ls
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.