Domain hosting, cheap domain name & website promotion services
  

 Home

Red Hat Linux 7.3: The Official Red Hat Linux Getting Started Guide
PrevChapter 12. 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 file extensions and their meanings:

Compressed and Archived Files

  • .bz2 — a file compressed with bzip2

  • .gz — a file compressed with gzip

  • .tar — a file archived with tar (short for tape archive), also known as a tar file

  • .tbz — a tarred and bzipped file

  • .tgz — a tarred and gzipped file.

For information on working with bzip2, gzip, and tar files, refer to the Section called File Compression and Archiving.

File Formats

  • .au — an audio file

  • .gif — a GIF image file

  • .html/.htm — an HTML file

  • .jpg — a JPEG image file

  • .pdf — an electronic image of a document

  • .png — a PNG image file

  • .ps — a PostScript file; formatted for printing

  • .txt — a plain ASCII text file

  • .wav — an audio file

  • .xpm — an image file

System Files

  • .conf — a configuration file

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

  • .rpm — a Red Hat Package Manager file used to install software

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:

file saturday

It will display ASCII text, telling you it is a text file. Any file that is designated a text file should be readable using the cat, more, or less commands.

TipTip
 

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.


PrevHomeNext
Managing Files and DirectoriesUpFile Compression and Archiving
 

 

 

 

Cheap domains by 895cheap-domain.com | Register cheap domain names 

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

 

 
Quotes: Better keep yourself clean and bright; you are the window through which you must see the world.