Unix File Extension Conventions
Some other operating systems have filenames of the form of
a base name, a dot, and a one- to three-character file type or file
extension. These extensions serve an important purpose: they indicate
that the file contents belong to a particular class of data. For
example, an extension pas
could mean
that the file contains Pascal source code, and exe
would identify a binary executable
program.
There is no guarantee that file contents are reflected in their file extensions, but most users find them a useful custom, and follow convention.
Unix too has a substantial number of common file extensions, but Unix filenames are not forced to have at most one dot. Sometimes, the extensions are merely conventional (e.g., for most scripting languages). However, compilers generally require particular extensions, and use the base name (after stripping the extension) to form the names of other related files. Some of the more common extensions are shown in Table B-1.
Table B-1. Common Unix file extensions
Extension | Contents |
---|---|
| Digit one. Manual page for section 1 (user commands) |
| Library archive file |
| awk language source file |
| File compressed by bzip2 |
| C language source file |
| C++ language source file |
| PostScript page-description language source file |
| Fortran 77 language source file |
| File compressed by gzip |
| Fortran 90/95/200x language source file |
| C language header file |
| HyperText Markup Language file |
| Object ... |
Get Classic Shell Scripting now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.