Difference between revisions of "LS"

From Void-Byte
Jump to navigation Jump to search
 
Line 12: Line 12:
 
|-
 
|-
 
| -a
 
| -a
|List all files including hidden.
+
|List files including hidden.
 
|-
 
|-
 
| -d
 
| -d
Line 30: Line 30:
 
|}
 
|}
  
== Examples ==
+
==Examples==
<br />
+
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

Latest revision as of 15:12, 7 June 2020

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