dir
Quick Reference
Command Name:
dir
Category:
file management
Platform:
Linux/Unix
Basic Usage:
Common Use Cases
- 1
Directory listing
List files and directories in the current or specified directory
- 2
File information
Display detailed file attributes including permissions and size
- 3
System navigation
Explore the filesystem structure to locate files
- 4
File management
Identify files for operations like copying, moving, or deletion
Syntax
dir [OPTION]... [FILE]...
Options
Option | Description |
---|---|
-a, --all |
Do not ignore entries starting with . |
-l |
Use a long listing format |
-h, --human-readable |
Print sizes in human readable format |
-R, --recursive |
List subdirectories recursively |
-S |
Sort by file size, largest first |
-t |
Sort by modification time, newest first |
--color[=WHEN] |
Colorize the output; WHEN can be 'always', 'auto', or 'never' |
-1 |
List one file per line |
Examples
How to Use These Examples
The examples below show common ways to use the dir
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.