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),
-l |
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.
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.
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, aka permssion flags, are three fields of three characters each
(ex: rwxrwxr-x
) :
u
ser whos owns the object , g
roup members , and others. r
the object is readable; -
not readable. w
the object is writable; -
not writable. S
the object is not executable
set-user-ID
is set.
set-group-ID
is set. s
the file is executable
x
file is executable or directory is searchable. -
object 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 one extended attribute 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 OR xattr -c file # clear all
-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
total nnnnnn
number of 512-byte blocks used by the files in the directory is displayed on a line by itself before the files.
exits 0 on success, and >0 if an error occurs.
$BLOCKSIZE | default is 512 although frequently set to 1K in .profile .
| ||||||||||||||||||||||||||||||||||||||||
$CLICOLOR |