Encyclopedia > Ls

  Article Content


ls (abbreviated from "LiSt") is a command in the Unix and Linux operating systems. It is similar to "dir" in DOS.

When executed, the ls command lists the contents of the current directory (or the given arguments) in the Unix/Linux command line interface (CLI). Seeming like one of the most used Unix commands, it's appropriately loaded with available options. Here is a sample display of its usage:

Table of contents

Sample ls Search

Brandon@BRANDON /
$ ls -laF
total 4
drwxr-xr-x   10 Brandon  None            0 Sep 30 16:48 ./
drwxr-xr-x   10 Brandon  None            0 Sep 30 16:48 ../
drwxr-xr-x    3 Brandon  None            0 Sep 30 19:02 bin/
-rw-r--r--    1 Brandon  None           89 Dec 16 12:24 brandonforgodtest
-rwxr-xr-x    1 Brandon  None           57 Sep 30 19:22 cygwin.bat*
-rw-r--r--    1 Brandon  None          766 Sep 30 19:22 cygwin.ico
drwxr-xr-x   15 Brandon  None            0 Sep 30 16:48 etc/
drwxr-xr-x    3 Brandon  None            0 Sep 30 19:27 home/
drwxr-xr-x   21 Brandon  None            0 Sep 30 19:02 lib/
drwxr-xr-x    2 Brandon  None            0 Sep 30 19:14 sbin/
-rw-r--r--    1 Brandon  None           22 Dec 16 12:24 testb3
drwxr-xr-x    3 Brandon  None            0 Sep 30 19:02 tmp/
drwxr-xr-x   20 Brandon  None            0 Sep 30 19:02 usr/
drwxr-xr-x    6 Brandon  None            0 Sep 30 19:02 var/

Explanation of Sample Search Options

The above search uses three popular options:

  • l - long listing (without this, ls produces only the filenames column.
  • F - Shows characters on the filenames column telling you what the listings are. In this case: * = executable, / = directory, [nothing] = normal file.
  • a - Show all files (including . and .. listings)

Breakdown of output

The output given by ls in long listing form is broken into columns, as can be seen above. These columns can then be broken down to acquire information about listed files, directories and devices.

This is the tabular form of the first two listed items from the sample above with headings to explain each column:

Type Permissions Number of hard links[?] Owner Group Size Date modified Listing name
d rwxr-xr-x 3 Brandon None 0 Sep 30 19:02 bin/
- rw-r--r-- 1 Brandon None 89 Dec 16 12:24 brandonforgodtest

Type column description

The very first character in a long listing gives the type of file.

Character Type
- Normal file
b Block device
c Character device
d Directory
l Symbolic link
p Named pipe (FIFO)
s Domain socket

Permissions column description





Meaning of Characters by Location

The other characters are divided into groups as follows the way I understand it:

123: Owner's permissions on this item;
456: Group's permission to this item;
789: World (everyone else's) permission to this item;

Meaning of Characters by Character

As for the individual character meanings, the following is meant to explain that:

r - read permission;
w - write permission;
x - execute permission;
- - no permission;


In attempt to clarify, here is a detail-explanation of the example permission section I used in this section:

In the preceeding example (drwxr-xr--),

  • This item is a directory;
  • The file owner may read write and execute this item myself;
  • The group this file belongs to may read and execute this file but not write to it;
  • Everyone else may read this item but not write to it or execute it

All Wikipedia text is available under the terms of the GNU Free Documentation License

  Search Encyclopedia

Search over one million articles, find something about almost anything!
  Featured Article
French resistance

... Combat Zone Nord[?] Comite d’Action Socieliste[?] (CAS) - Founded in January 1941 by Daniel Mayer[?], member of the French Socialist Party[?]. Later it was lead ...

This page was created in 34.9 ms