Linux - ls (List directory content)

> Procedural Languages > Bash Shell and (Unix|Linux) Utilities (XCU) > Bash - File System

1 - About

Linux Command to list the contents of a directory ll is an alias of “ls -la”

Check also the find command


3 - Syntax

ls [option] [file}

4 - Example

ls -alt

5 - Options

5.1 - long format (l)

The -l option lists files and directories as a table with the following structure:

  • the number of child's (directory and file)
  • the owner name
  • the group owner name
  • the size of the file in bytes
  • the date and time of the last modification
  • the name of the file or directory

5.2 - order (t)

The -t option orders files and directories by the time they were last modified.

5.3 - hidden files and directory (a)

5.4 - Only file name

ls -A1