NAME

ls - list file/directory information

SYNOPSIS

ls [-1RSacdfiklnrstu] [file ...]

DESCRIPTION

This program lists information about files and directories. If it is invoked without file/directory name arguments, it lists the contents of the current directory. Otherwise, ls lists information about the files and information about the contents of the directories (but see -d). Furthermore, without any option arguments ls just lists the names of files and directories. All files are listed before all directories. The default sort order is ascending ASCII on filename.

OPTIONS

The BSD options '1ACFLRSTWacdfgiklmnopqrstux' are recognized, but only '1RSacdfiklnrstu' are implemented:

-1

List entries 1 per line (default if output is not a tty).

-R

Recursively list the contents of all directories, breadth-first.

-S

Sort descending by size.

-a

List all files (normally files starting with '.' are ignored).

-c

Sort by descending last modification time of inode.

-d

Do not list directory contents.

-f

Do not sort -- list in whatever order files/directories are returned by the directory read function. This option implies -a.

-i

List file inode number. (Doesn't mean much on non-inode systems.)

-k

When used with -s, list file/directory size in 1024-byte blocks.

-l

Long format listing of mode -- # of links, owner name, group name, size in bytes, time of last modification, and name.

-n

List numeric uid and gid (default on platforms without getpwuid()).

-r

Reverse sorting order.

-s

List file/directory size in 512-byte blocks. (May not mean much on non-Unix systems.)

-t

Sort by descending last modification time.

-u

Sort by descending last access time.

ENVIRONMENT

The working of ls is not influenced by any environment variables.

BUGS

The file metadata from stat() is used, which may not necessarily mean much on non-Unix systems. Specifically, the uid, gid, inode, and block numbers may be meaningless (or less than meaningful at least).

The -l option does not yet list the major and minor device numbers for special files, but it does list the value of the 'dev' field as 2 hex 16-bit words. Doing this properly would probably require filesystem type probing.

AUTHOR

This Perl implementation of ls was written by Mark Leighton Fisher of Thomson Consumer Electronics, fisherm@tce.com.

COPYRIGHT and LICENSE

This program is free and open software. You may use, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same.