1. ls(1)
  2. ls(1)

NAME

ls - list directory contents

SYNOPSIS

ls [-aldRqrtcTGFDX] [-f field] [-s date] [-m num] [-n depth] [file...]

DESCRIPTION

ls converts pathnames into File(2) objects. For each path of a type other than a directory, ls produces the files contained within that directory. If no operands are given, the contents of the current directory are produced.

By default, ls output on a terminal displays an HTML representation of the file. If files are displayed from multiple directories, "header" lines are printed to indicate the directory. These lines are produced only when the output is a terminal; otherwise a stream of pure objects is produced. Some options like -l and -G cause strings to be generated instead of objects.

ls adds a _path property to the File(2) object emitted, which contains the relative path as seen by ls. This can be used by downstream commands to do their own lookup(2).

The following options are available:

DIAGNOSTICS

The ls command exits with true on success and non-true if an error occurs.

BUGS

Lots. Use -R and friends with caution.

  1. January 2015
  2. ls(1)