|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.
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
-i, -s, and -l .
The 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
rwx ) :
userwhos owns the object ,
groupmembers , and
rthe object is readable;
wthe object is writable;
xfile is executable or directory is searchable;
+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 -d com.apple.quarantine morse OR xattr -c file # clear all
Sthe object is not executable
sthe file is executable
Tsticky 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.
/tmpwhich must be publicly writable but users are prohibited from removing or rename other's files.
tsticky 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.
|default is 512 although frequently set to 1K in |
| column width for displaying multiple-text-column output. |
| colon-delimited list of minimum column widths.
inode, block count, links, uname, group, flags, size, name.
>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 ).
|timezone to use when displaying dates. See environ|
May 19, 2002 BSD