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 -i, -s, and -l
.
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: rwx
rwx
rwx
) :
user
whos owns the object , group
members , and
others
. r
the object is readable; -
not readable. w
the object is writable; -
not writable. x
file is executable or directory is searchable; -
Inaccessable
+
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@ drwxr-xr-x@ 12 dgerman staff 408 Oct 8 12:14 morse com.apple.quarantine 46This extended attribute can be deleted using
xattr
.
xattr -d com.apple.quarantine morse OR xattr -c file # clear all
S
the object is not executable
set-user-ID
is set.
set-group-ID
is set. s
the file is executable
T
sticky bit is set on a directory.
Files in a sticky directory may only be removed or renamed if the user has write permission for the directory and
the user is the owner of the file, the owner of the directory, or the superuser. /tmp
which must be publicly writable but
users are prohibited from removing or rename other's files.chmod
.
t
sticky bit is set (mode 1000).
A sticky file was originally intended to indicate to the memory managment routines that this file had a preference for being
retained in memory even if no process was connected to it. It was expectd to be used again soon and frequently. Advances in memory caching
has lead to this usually being ignored.
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 blocks used by the files in the directory is displayed on a line by itself before the files. Each file on a takes up at least 4 blocks.
$BLOCKSIZE | default is 512 although frequently set to 1K in .profile .
|
$COLUMNS | column width for displaying multiple-text-column output.
|
$LS_COLWIDTHS | colon-delimited list of minimum column widths.
inode, block count, links, uname, group, flags, size, name.
example: >LS_COLWIDTHS='10:4:4:7:5:12:6:40' >/bin/ls -l 0* -rw-r--r-- 1 dgerman staff 721 May 22 17:01 0 -rw-r--r--@ 1 dgerman staff 4534 Apr 24 11:05 0.html -rw-r--r-- 1 dgerman staff 5067 May 22 17:01 00 -rw-r--r-- 1 dgerman staff 1800 Apr 27 15:47 09 -rwxr-xr-x 1 dgerman staff 29230 Aug 28 2017 0finderDefaults.txt -rw-r--r-- 1 dgerman staff 18694 Mar 28 13:50 0fud -rw-r--r-- 1 dgerman staff 721 May 22 17:02 0s > /bin/ls -l # notice wider size column neeed by 7 digit size of jpg file -rw-r--r-- 1 dgerman staff 721 May 22 17:01 0 -rw-r--r--@ 1 dgerman staff 4534 Apr 24 11:05 0.html drwxrwxr-x 16 dgerman staff 544 Oct 8 2016 Homebrew1 -rwxr-xr-x@ 1 dgerman staff 1185182 Feb 17 16:43 IMG_3550-X5.jpg > LS_COLWIDTHS='10:4:4:7:5:12:6:30' > ls --stop_rm_star* Birdlog.addrs* UPSs.html* phoneNumbers.txt 1 DGGNJdl.jpg* biggiesOpenS.txt* profilesave* 1.html DGG_USpp503-925-913.jpg* bin@ sayWords* > LS_COLWIDTHS='10:4:4:7:5:12:6:35' > ls --stop_rm_star* Desktop/ lib-functions* 1 Documents/ livehosts* 1.html Downloads/ log/ > LS_COLWIDTHS='10:4:4:7:5:12:6:40' > ls 1 UPSs.html* 1.html biggiesOpenS.txt* 11 bin@ 11.html* bsa.log 11s defaults.180525.txtZero signifies a dynamically sized ).
|
$LANG | The locale to use when determining the order of day and month in the long -l format output. See environ .
|
$TERM
| |
$TZ | timezone to use when displaying dates. See environ |
May 19, 2002 BSD