If you are new to Linux, you may see files with extensions you do not
recognize. A file's extension is the last part of a file's name after
the final dot (in the file sneakers.txt,
"txt" is that file's extension).
Programming and Scripting Files
.c — a C program language source code
file
.cpp — a C++ program language source
code file
.h — a C or C++ program language
header file
.o — a program object file
.pl — a Perl script
.so — a library file
.tcl — a TCL script
But file extensions are not always used, or used consistently. So what
happens when a file does not have an extension, or the file does not
seem to be what the extension says it is supposed to be?
That is when the file command can be helpful.
For instance, you find a file called saturday
without an extension. Using the file command, you can
tell what type of file it is by typing:
In the example, the command file saturday will
display ASCII text, telling you it is
a text file. Any file that is designated as a text file should be
readable using the cat, more, or
less commands, or using a text editor.
 | Tip |
|---|
| | To learn more about file, read the
man page by typing man file.
|
For more information on helpful commands for reading files, see
Chapter 11.