LS
Contents
Description
The ls command is used to list the contents of a directory.
Structure
ls <options> <path/file>
Options
Option | Description |
---|---|
-a | List files including hidden. |
-d | List directories, but omit contents. |
-h | Human readable format. |
-l | Long listing format. |
-R | List all files in directories recursively. |
-t | Sort by time of file in numerical order. |
Examples
List files in the current directory in long listing format and human readable.
ls -alh
List files in the current directory and the contents of directories in numerical order by modify date/time.
ls -tR