dependent on type
|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.
-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),
-1†, -C, -x, and
-l override each other; the last one specified is used.
Sort time choices:
-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.
-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
-x (multi column formats.)
File information is displayed with blanks separating the information associated with the -i, -s, and -l options.
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
If the owner or group names are not known (example they have been deleted), or
-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
type character describes the type of file :
- Regular file.
l Symbolic link.
b Block special file.
c Character special file.
s Socket link.
The mode, aka permssion flags, are three fields of three characters each
rwxrwxr-x ) :
user whos owns the file ,
group members , and others.
rthe file is readable;
wthe file is writable;
Sthe file is not executable
sthe file is executable
xfile is executable or directory is searchable.
-file is neither readable, writable, executable, nor set-user-ID nor set-group-ID mode, nor sticky.
Tsticky bit is set (mode 1000), but not execute or search permission.
tsticky 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
xattr -d com.apple.quarantine morse OR xattr -c file # clear all
total nnnnnn number of 512-byte blocks used by the files in the directory is displayed on a line by itself before the files.
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.
|default is 512 although frequently set to 1K in |
May 19, 2002 BSD