Sodamhan.com

TL;DR

ls

List directory contents. More information: https://www.gnu.org/software/coreutils/ls.

  • List files one per line:

ls -1

  • List all files, including hidden files:

ls -a

  • List files with a trailing symbol to indicate file type (directory/, symbolic_link@, executable*, …):

ls -F

  • List all files in long format (permissions, ownership, size, and modification date):

ls -la

  • List files in long format with size displayed using human-readable units (KiB, MiB, GiB):

ls -lh

  • List files in long format, sorted by Size (descending) Recursively:

ls -lSR

  • List files in long format, sorted by time the file was modified and in reverse order (oldest first):

ls -ltr

  • Only list directories:

ls -d */

This document was created using the contents of the tldr project.