home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam    

Unix Power ToolsUnix Power ToolsSearch this book

1.12. Filename Extensions

In Microsoft Windows and some other operating systems, filenames often have the form name.extension. For example, plain text files have extensions such as .txt. The operating system treats the extension as separate from the filename and has rules about how long it must be, and so forth.

Unix doesn't have any special rules about extensions. The dot has no special meaning as a separator, and extensions can be any length. However, a number of programs (especially compilers) make use of extensions to recognize the different types of files they work with. In addition, there are a number of conventions that users have adopted to make clear the contents of their files. For example, you might name a text file containing some design notes notes.txt.

Table 1-1 lists some of the filename extensions you might see and a brief description of the programs that recognize them.

Table 1-1. Filename extensions that programs expect

Extension

Description

.a

Archive file (library)

.c

C program source file

.f

FORTRAN program source file

.F

FORTRAN program source file to preprocess

.gz

gzip ped file (Section 15.6)

.h

C program header file

.html or .htm

HTML file for web servers

.xhtml

XHTML file for web servers

.o

Object file (compiled and assembled code)

.s

Assembly language code

.z

Packed file

.Z

Compressed file (Section 15.6)

.1 to .8

Online manual (Section 2.1) source file

~

Emacs editor backup file (Section 19.4)

In Table 1-2 are some extensions often used by users to signal the contents of a file, but are not actually recognized by the programs themselves.

Table 1-2. Filename extensions for user's benefit

Extension

Description

.tar

tar archive (Section 39.2)

.tar.gz or .tgz

gzip ped (Section 15.6) tar archive (Section 39.2)

.shar

Shell archive

.sh

Bourne shell script (Section 1.8)

.csh

C shell script

.mm

Text file containing troff's mm macros

.ms

Text file containing troff's ms macros

.ps

PostScript source file

.pdf

Adobe Portable Document Format

--ML and TOR



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.











??????????????@Mail.ru