Web page hosting, cheap domain name & website promotion services
  

 Home

Red Hat Linux 7.2: The Official Red Hat Linux Getting Started Guide
PrevChapter 11. Managing Files and DirectoriesNext

Identifying and Working with File Types

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).

Here is a brief listing of extensions and their meanings:

Compressed/Archived Files

  • .Z — a compressed file

  • .tar — an archive file (short for tape archive)

  • .gz — a compressed file (gzipped)

  • .tgz — a tarred and gzipped file

For information on creating zip and tar files, see the section called File Compression and Archiving with Gzip, Zip, and Tar

File Formats

  • .txt — a plain ASCII text file

  • .html/.htm — an HTML file

  • .ps — a PostScript file; formatted for printing

  • .au — an audio file

  • .wav — an audio file

  • .xpm — an image file

  • .jpg — a graphical or image file, such as a photo or artwork

  • .gif — a graphical or image file

  • .png — a graphical or image file

  • .pdf — an electronic image of a document

For information on viewing and creating PDF files, see the section called Viewing PDFs

System Files

  • .rpm — a Red Hat Package Manager file

  • .conf — a configuration file

  • .a — an archive file

  • .lock — a "lock" file; determines whether a program is in use

Programming and Scripting Files

  • .h — a C or C++ program language header file

  • .c — a C program language source code file

  • .cpp — a C++ program language source code file

  • .o — a program object file

  • .pl — a Perl script

  • .tcl — a TCL script

  • .so — a library file

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's when the file command can be helpful.

In the section called Using Redirection in Chapter 10, you created a file called saturday, without an extension. Using the file command, you can tell what the file is by typing:

file saturday

and you will see ASCII text, or something similar, telling you it is a text file. Any file that is designated a text file should be readable using cat, more, or less.

TipRead the Man Page
 

To learn more about file, read the man page by typing man file.

For more information on helpful commands for reading files, see Chapter 10.


PrevHomeNext
A Larger Picture of the FilesystemUpFile Compression and Archiving with Gzip, Zip, and Tar
 

 

 

 

Website promotion and ranking services | Active-Domain.com: Domain name registration | Cheap domain registrar 

Disclaimer: For authoritative source or latest update to this documentation, please refer to http://www.redhat.com/docs/manuals/linux/

 

 
Quotes: "Absence in love is like water upon fire; a little quickens, but much extinguishes it."