Classic Shell Scripting - Arnold Robbins [250]
sh
Bourne-family shell script
so
Shared-object library (called a dynamic load library on some systems)
tar
Tape archive file (from the tar utility)
,v
cvs and rcs history file
z
Compressed file from pack (rare)
Z
Compressed file from compress
Notably absent from this table is exe. While several other operating systems use that extension for binary executable programs, and permit the extension to be omitted when using the filename as a command name, Unix does not use any particular extension for executable files (file permissions serve that purpose), and Unix software rarely permits file extensions to be dropped.
Several Unix text editors offer the user the option of creating temporary backup files so that the state of a long editing session can be safely recorded in the filesystem at suitable intervals. There are several conventions for naming these backup files: prefixes and/or suffixes of sharp (#) and tilde (~), or a suffix that includes tildes and a number, such as .~1~, .~2~, and so on. The latter mimic the file generation numbers provided by some other filesystems, a feature that Unix does not explicitly provide, but effectively permits through flexible file-naming rules.
File generation numbers used in other systems provide a way to retain multiple versions of a file, with the convention that an omitted generation number refers to the highest-numbered generation. Unix offers better ways of handling file version histories: software tools that preserve the history as differences from a base version, together with commentary that describes why the change was made. The original such package was AT&T's Source Code Control System (sccs), but today, the Revision Control System (rcs) (see Section C.5 in Appendix C) and the Concurrent Versions System (cvs) are more common.
Summary
This completes our tour of the workings of the Unix filesystem. By now, you should be familiar with its main features:
Files are streams of zero or more 8-bit bytes, without any additional structure other than the use of newline characters to mark line boundaries in text files.
Bytes are usually interpreted as ASCII characters, but the UTF-8 encoding and the Unicode character set permit graceful evolution of the Unix filesystem, pipes, and network communications to support millions of different characters from all of the world's writing systems, without invalidating the majority of existing files or software.
Files have attributes, such as timestamps, ownership, and permissions, allowing a much greater degree of access control and privacy than is available on some other desktop operating systems, and eliminating most computer virus problems.
Access to entire directory trees can be controlled at a single point by suitable settings of directory permissions.
The maximum file size is large enough to rarely be a problem, and newer filesystem designs raise the maximum well beyond the limits of current technology.
The maximum filename and pathname lengths are much longer than you are likely to need in practice.
A clean hierarchical directory structure with slash-separated path components, together with the mount command, allows logical filesystems of potentially unbounded size.
File-like views of other data are possible, and encouraged, to simplify data processing and use by humans.
Filenames may use any character other than NUL or slash, but practical considerations of portability, readability, and shell wildcarding sharply limit the characters that should be used.
Filenames are case-sensitive (except in Mac OS X's non-Unix HFS filesystems).
Although the filesystem does not impose rules on filename structure, many programs expect files to be named with particular dotted extensions, and they replace the extensions with other ones when creating related files. The shells encourage this practice through their support of wildcard patterns like ch01.* and *.xml.
Filenames are stored in a directory file, whereas information about the file, the file metadata, is stored