[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
These options affect the information that ls
displays. By
default, only file names are shown.
//DIRED// beg1 end1 beg2 end2 ... |
The begN and endN are unsigned integers that record the byte position of the beginning and end of each file name in the output. This makes it easy for Emacs to find the names, even when they contain unusual characters such as space or newline, without fancy searching.
If directories are being listed recursively (-R
), output a similar
line with offsets for each subdirectory name:
//SUBDIRED// beg1 end1 ... |
Finally, output a line of the form:
//DIRED-OPTIONS// --quoting-style=word |
Here is an actual example:
$ mkdir -p a/sub/deeper a/sub2 $ touch a/f1 a/f2 $ touch a/sub/deeper/file $ ls -gloRF --dired a a: total 8 -rw-r--r-- 1 0 Nov 9 18:30 f1 -rw-r--r-- 1 0 Nov 9 18:30 f2 drwxr-xr-x 3 4096 Nov 9 18:30 sub/ drwxr-xr-x 2 4096 Nov 9 18:30 sub2/ a/sub: total 4 drwxr-xr-x 2 4096 Nov 9 18:30 deeper/ a/sub/deeper: total 0 -rw-r--r-- 1 0 Nov 9 18:30 file a/sub2: total 0 //DIRED// 55 57 98 100 141 144 186 190 252 258 327 331 //SUBDIRED// 2 3 195 200 263 275 335 341 //DIRED-OPTIONS// --quoting-style=literal |
Note that the pairs of offsets on the `//DIRED//' line above delimit these names: `f1', `f2', `sub', `sub2', `deeper', `file'. The offsets on the `//SUBDIRED//' line delimit the following directory names: `a', `a/sub', `a/sub/deeper', `a/sub2'.
Here is an example of how to extract the fifth entry name, `deeper', corresponding to the pair of offsets, 252 and 258:
$ ls -gloRF --dired a > out $ dd bs=1 skip=252 count=6 < out 2>/dev/null; echo deeper |
Note that although the listing above includes a trailing slash
for the `deeper' entry, the offsets select the name without
the trailing slash. However, if you invoke ls
with `--dired'
along with an option like `--escape' (aka `-b') and operate
on a file whose name contains special characters, notice that the backslash
is included:
$ touch 'a b' $ ls -blog --dired 'a b' -rw-r--r-- 1 0 Nov 9 18:41 a\ b //DIRED// 40 44 //DIRED-OPTIONS// --quoting-style=escape |
If you use a quoting style that adds quote marks
(e.g., `--quoting-style=c'), then the offsets include the quote marks.
So beware that the user may select the quoting style via the environment
variable QUOTING_STYLE
. Hence, applications using `--dired'
should either specify an explicit `--quoting-style=literal' option
(aka `-N' or `--literal') on the command line, or else be
prepared to parse the escaped names.
ls
, so we
provide this option for compatibility.)
Normally the size is printed as a byte count without punctuation, but this can be overridden (see section 2.2 Block size). For example, `-h' prints an abbreviated, human-readable count, and `--block-size="'1"' prints a byte count with the thousands separator of the current locale.
For each directory that is listed, preface the files with a line `total blocks', where blocks is the total disk allocation for all files in that directory. The block size currently defaults to 1024 bytes, but this can be overridden (see section 2.2 Block size). The blocks computed counts each hard link separately; this is arguably a deficiency.
The permissions listed are similar to symbolic mode specifications
(see section 26.2 Symbolic Modes). But ls
combines multiple bits into the
third character of each set of permissions as follows:
Following the permission bits is a single character that specifies whether an alternate access method applies to the file. When that character is a space, there is no alternate access method. When it is a printing character (e.g., `+'), then there is such a method.
Normally the disk allocation is printed in units of 1024 bytes, but this can be overridden (see section 2.2 Block size).
For files that are NFS-mounted from an HP-UX system to a BSD system,
this option reports sizes that are half the correct values. On HP-UX
systems, it reports sizes that are twice the correct values for files
that are NFS-mounted from BSD systems. This is due to a flaw in HP-UX;
it also affects the HP-UX ls
program.
[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |