- List of file extensions
- Contents
- 0-9
- A
- B
- C
- D
- E
- F
- G
- H
- I
- J
- K
- L
- M
- O
- P
- R
- S
- T
- W
- X
- Z
- Find All Files with Extension in Linux
- Find command
- Locate command
- Conclusion:
- About the author
- Talha Saif Malik
- How to Find Out File Types in Linux
- Types of File and Explanation
- Regular Files
- Directory Files
- Special Files
- 1. Block Files:
- 2. Character device files:
- 3. Pipe Files:
- 4. Symbol link files:
- 5. Socket Files:
List of file extensions
This is a list of common file extensions. Keep in mind that extensions are arbitrary and, whenever there’s any doubt, the file command will generally provide a more accurate indicator of file contents than the extension.
Contents
0-9
- .1, etc. — man pages generally fall into numerical categories (though there are others) and have a suffix indicating the section. Logrotate also names old log file with an extra numerical extension.
A
B
- .blend — Blender 3D scene
- .bmp — Bitmap image format
- .bz2 — a file processed with bzip2 compression (see .tar)
C
- .c — C source code
- .class — Java class, compiled bytecode
- .conf — configuration file
- .cfg — configuration file
- .cpp — C++ source code
- .cc — C++ source code (not as common as *.cpp)
- .css — CSS, Cascading StyleSheet
- .csv — a plain text file containing comma separated values
D
- .db — Berkeley DB
- .deb — Debian package
- .desktop — Desktop entry, standard link/shortcut/launcher format
- .diff — patch/difference file generated by diff
- .dtd — DTD, Document Type Definition for XML data
E
F
G
- .gif — image file which uses the patentedLZW compression algorithm
- .gz — a file processed with gzip compression (see .tar)
H
I
J
K
- .kwd — KDEs native format for their Kword word processor
- .ksp — KDEs native format for their Kspread spreadsheet application
- .kss — KDEs screensaver format
L
M
- .m3u — playlist file, originates from WinAmp
- .m4a — compressed MPEG-4 audio file without DRM
- .m4p — compressed MPEG-4 audio file with DRM
- .md5 — file containing an md5sum for a single file. IE: foobar.iso.md5 contains the md5sum for foobar.iso
- .md5sums — file containing a list of MD5 checksums, generated and used by md5sum
- .mo — Compiled message catalog, generated and used by GNU gettext
- .mpg or .mpeg — compressed video file
- .mp3 — compressed MP3 audio file
O
P
- .patch — patch file, generated by diff, to be used with patch
- .pdf — PDF, Adobe Portable Document file.
- .php — PHP source file
- .phps — PHP source file in which the source is intended to be displayed rather than executed
- .phtml — PHP source file (uncommon)
- .pl — Perl source code
- .pls — a playlist file (file of filenames or URLs)
- .png — PNG image file
- .pov — source code for the povray ray tracer
- .properties — value containing configuration values, used by Java applications
- .ps — postscriptfile. Like pdf, but without form functionality.
- .py — python script
- .pyo — python optimized bytecode
- .pyc — python compiled bytecode
R
- rc — not really an extension, but often found at the end of ‘run control’ (or ‘resource configuration’) files such as ‘bashrc’.
- .rdf — «Resource Description Framework» file, XML based format
- .rpm — originally a Red Hat package (the RedHat Package Manager) but now many distros are rpm based.
- .rtf — rich text format. A Lowest common denominator format for exchanging documents between different word processors
S
- .s or .S — assembly language source code
- .sh — shellscript (as with nearly all extensions, this is optional)
- .so — Shared object/library file
T
- .tar — a file archived with tar (the tape archiver) — often also compressed with gzip, bzip2, etc., in which case it will have a double extension of ‘tar.gz’, ‘.tar.bz2’, etc.
- .tgz — possibly a .tar.gz file with the shorter extension but more likely these days to be a Slackware package like a .deb or .rpm
- .tga — Targa image file
- .ttf — TTF (True Type) font
- .txt — plain text file.
W
X
- .xbel — XML based bookmarks file
- .xsd — XML Schema
- .xml — XML file
- .xsl — XSL stylesheet
- .xpm — X pixmap
Z
- .Z — rarely seen anymore, a compressed file, often tarred as .tar.Z
- .zip — Compressed Archive. More common on Windows, but can be read/written on UNIX using zip and unzip commands
Find All Files with Extension in Linux
Often, we find ourselves stuck when we have to find all files with the same or different extensions. This has most likely happened to various Linux users while using the terminal. It is one thing to search for a single file type or file, but what will you do when you want to find out all files simultaneously? This article comes to the rescue for our readers who have such a dilemma.
We can use various Linux utilities for finding or locating files on a file system, but searching all files or filenames with the same or different extensions can be difficult and require specific patterns or expressions. In the upcoming section of the article, we will understand the working, syntax, and execution of these utilities.
Find command
One of the most powerful file searching tools in the Linux system is the “find command.” It searches the entire directory for files and folders to get matched with the user’s expression and performs actions on these files. File permission, file size, type are some other factors based on finding files on Linux. Find command also be combined with other utilities such as sed or grep. Now, lets’ head towards the practical implication of find command.
Find command syntax:
Finding all files with a single extension:
To find all files with a file extension, write out its path to find a command with the options and expression specifying the extension. In the below-given example, we will find all files with the “.txt” extension.
“.” in this command denotes that this tool will find all the “.txt” files in the current directory.
Find “.exe” files in the same find command by adding the extension as “*exe.”
Configuration files are also an essential part of any file system that can be used for multiple purposes. Write out this command for searching configuration files in the current directory.
Finding files with multiple extension:
You can also add more than extension in your find command so that you can find several extension files easily and quickly.
The execution of below given command will retrieve files with extension “.sh” and “.txt”
Locate command
The locate command is a faster and better tool as compared with “find.” When a file is initiated, instead of searching it in the file system, locate utilize the database for the searching requirement. This database stores parts and bits of the information related to files and their addresses on your system.
locate command syntax:
Finding a file with a specific extension, such as “.conf,” which is considered in our case, adds the directory path where the process of searching files will occur.
Find configuration files in the present working directory by utilizing the below-given command.
Similarly, you can follow the syntax of locate command for finding all files with any specific extension such as “.txt.”
Conclusion:
This post covers two powerful yet simple utilities for you to find all files with the same or different extensions. We have provided you the fundamental concepts regarding the “find” and “locate” command and shown you how to utilize these two Linux command-line tools to find all files with several extensions.
About the author
Talha Saif Malik
Talha is a contributor at Linux Hint with a vision to bring value and do useful things for the world. He loves to read, write and speak about Linux, Data, Computers and Technology.
How to Find Out File Types in Linux
In Linux, everything is considered as a file. In UNIX, seven standard file types are regular, directory, symbolic link, FIFO special, block special, character special, and socket. In Linux/UNIX, we have to deal with different file types to manage them efficiently.
In Linux/UNIX, Files are mainly categorized into 3 parts:
The easiest way to find out file type in any operating system is by looking at its extension such as .txt, .sh, .py, etc. If the file doesn’t have an extension then in Linux we can use file utility. In this article, we will demonstrate file command examples to determine a file type in Linux.
To find out file types we can use the file command.
Syntax: file [OPTION…] [FILE…]
You can run the following command to verify the version of the file utility:
We can test a file type by typing the following command:
We can pass a list of files in one file and we can specify using the -f option as shown below:
cat file.txt file -f file.txt
Using the -s option we can read the block or character special file.
Using -b option will not prepend filenames to output lines
Using -F option will use string as separator instead of “:”.
Using -L option will follow symlinks (default if POSIXLY_CORRECT is set):
We can use the –extension option to print a slash-separated list of valid extensions for the file type found.
For more information and usage options, you can use the following command:
We can also use ls command to determine a type of file.
The following table shows the types of files in Linux and what will be output using ls and file command
File Type | Command to create the File | Located in | The file type using “ls -l” is denoted using | FILE command output |
---|---|---|---|---|
Regular FIle | touch | Any directory/Folder | – | PNG Image data, ASCII Text, RAR archive data, etc |
Directory File | mkdir | It is a directory | d | Directory |
Block Files | fdisk | /dev | b | Block special |
Character Files | mknod | /dev | c | Character special |
Pipe Files | mkfifo | /dev | p | FIFO |
Symbol Link Files | ln | /dev | l | Symbol link to |
Socket Files | socket() system call | /dev | s | Socket |
Types of File and Explanation
Regular Files
Regular files are ordinary files on a system that contains programs, texts, or data. It is used to store information such as text, or images. These files are located in a directory/folder. Regular files contain all readable files such as text files, Docx files, programming files, etc, Binary files, image files such as JPG, PNG, SVG, etc, compressed files such as ZIP, RAR, etc.
Or we can use the “file *” command to find out the file type
Directory Files
The sole job of directory files is to store the other regular files, directory files, and special files and their related information. This type of file will be denoted in blue color with links greater than or equal to 2. A directory file contains an entry for every file and sub-directory that it houses. If we have 10 files in a directory, we will have 10 entries in the directory file. We can navigate between directories using the cd command
We can find out directory file by using the following command:
We can also use the file * command
Special Files
1. Block Files:
Block files act as a direct interface to block devices hence they are also called block devices. A block device is any device that performs data Input and Output operations in units of blocks. These files are hardware files and most of them are present in /dev.
We can find out block file by using the following command:
We can use the file command also:
2. Character device files:
A character file is a hardware file that reads/writes data in character by character in a file. These files provide a serial stream of input or output and provide direct access to hardware devices. The terminal, serial ports, etc are examples of this type of file.
We can find out character device files by:
We can use the file command to find out the type of file:
3. Pipe Files:
The other name of pipe is a “named” pipe, which is sometimes called a FIFO. FIFO stands for “First In, First Out” and refers to the property that the order of bytes going in is the same coming out. The “name” of a named pipe is actually a file name within the file system. This file sends data from one process to another so that the receiving process reads the data first-in-first-out manner.
We can find out pipe file by using the following command:
We can use the file command to find out file type:
4. Symbol link files:
A symbol link file is a type of file in Linux which points to another file or a folder on your device. Symbol link files are also called Symlink and are similar to shortcuts in Windows.
We can find out Symbol link file by using the following command:
We can use the file command to find out file type:
5. Socket Files:
A socket is a special file that is used to pass information between applications and enables the communication between two processes. We can create a socket file using the socket() system call. A socket file is located in /dev of the root folder or you can use the find / -type s command to find socket files.
We can find out Symbol link file by using the following command:
We can use the file command to find out file type: