список содержимого каталога (list directory contents)
Использование в приложениях (Application usage)
Many implementations use the <equals-sign> ('='
) to denote
sockets bound to the file system for the -F
option. Similarly,
many historical implementations use the 's'
character to denote
sockets as the entry type characters for the -l
option.
It is difficult for an application to use every part of the file
modes field of ls -l
in a portable manner. Certain file types and
executable bits are not guaranteed to be exactly as shown, as
implementations may have extensions. Applications can use this
field to pass directly to a user printout or prompt, but actions
based on its contents should generally be deferred, instead, to
the test utility.
The output of ls (with the -l
and related options) contains
information that logically could be used by utilities such as
chmod and touch to restore files to a known state. However, this
information is presented in a format that cannot be used directly
by those utilities or be easily translated into a format that can
be used. A character has been added to the end of the permissions
string so that applications at least have an indication that they
may be working in an area they do not understand instead of
assuming that they can translate the permissions string into
something that can be used. Future versions or related documents
may define one or more specific characters to be used based on
different standard additional or alternative access control
mechanisms.
As with many of the utilities that deal with filenames, the
output of ls for multiple files or in one of the long listing
formats must be used carefully on systems where filenames can
contain embedded white space. Systems and system administrators
should institute policies and user training to limit the use of
such filenames.
The number of disk blocks occupied by the file that it reports
varies depending on underlying file system type, block size units
reported, and the method of calculating the number of blocks. On
some file system types, the number is the actual number of blocks
occupied by the file (counting indirect blocks and ignoring holes
in the file); on others it is calculated based on the file size
(usually making an allowance for indirect blocks, but ignoring
holes).