BSD options. | linux options |
--
terminates options, useful when filenames begin with a -
For a file: display its name and attributes.
For a directory: displays the files in that directory and attributes.
use -d
to display attributes of the directory.
If no operands are given, the contents of the current directory are displayed.
If more than one operand is given (or implied with shell pattern match),
no options | Alphabetically, all UPPER CASE before lowercase, down first column, then second column ( see |
Column formats: -1†, -C, -x,
and -l
override each other; the last one specified is used.
Sort time choices: -c
(change) and -u
(access) override each other; the last one specified isused.
Filename display : -b As -B
, but use C escape codes whenever possible.
-B, -b, -w,
and -q
override each other; the last one specified determines the format used for non-displayable characters.
Symbolic Links: -H, -L
and-P
override each other (either partially or fully); they are applied in the order specified.
Default, one entry per line to standard output; to terminals or with -C
or -x
(multi column formats.)
File information is displayed with blanks separating the information associated with the -i, -s, and -l options.
-l
displays : type
, mode, number of links, owner, group, number of bytes in the file, month, day-of-month, hour, minute file last modified, and the pathname.
If the modification time of the file is more than 6 months ago, the year is displayed instead of the hour and minutes
(see -T
).
If the owner or group names are not known (example they have been deleted), or
with -n
numeric ID's are displayed.
For character special or block special files the major and minor device numbers for the file are displayed in the size field.
For symbolic links a ->
and the pathname of the linked-to file is displayed
The type
character describes the type of file :
-
Regular file.
d
Directory.
l
Symbolic link.
b
Block special file.
c
Character special file.
s
Socket link.
p
FIFO.
The mode, the permssion flags, are three fields of three characters each
(ex: rwxrwxr-x
) :
u
ser whos owns the file , g
roup members , and others. r
the file is readable; -
not readable. w
the file is writable; -
not writable. S
the file is not executable
s
the file is executable
x
file is executable or directory is searchable. -
file is neither readable, writable, executable, nor set-user-ID nor set-group-ID mode, nor sticky. T
sticky bit is set (mode 1000), but not execute or search permission. t
sticky bit is set (mode 1000), and is searchable or executable. (See chmod or sticky for more details)
+
the file or directory has Access Control List attributes. (See chmod ACL
@
the file or directory has extended attributes xattr.( on Apple Mac, Darwin BSD chmod) may have beed saved from an email attachment by Thunderbird.
ls -l@This can be deleted using
drwxr-xr-x@ 12 dgerman staff 408 Oct 8 12:14 morse
com.apple.quarantine 46
xattr
xattr -d com.apple.quarantine morse
total nnnnnn
number of 512-byte blocks used by the files in the directory is displayed on a line by itself before the files.
EXAMPLES
Sort by size (and shows why ls does not need a separate option for this):
ls -l | sort -n +4
-r
reverse sort order.
exits 0 on success, and >0 if an error occurs.
$BLOCKSIZE | default is 512.
| ||||||||||||||||||||||||||||||||||||||||
CLICOLOR |
SEE ALSO stat, chflags, chmod, sort, xterm, compat, termcap, symlink, sticky