Sunday, May 28, 2023
rated 0 times [  10] [ 0]  / answers: 1 / hits: 5641  / 1 Year ago, mon, may 23, 2022, 6:00:54

Knowing file extensions really helps to understand what a program is doing or using. What are some common one's and how do I extract them?

More From » command-line


File extension are up to the creator of the file. In Linux you can name something music.mp3 but if it is a text file it will open with gedit if that is your texteditor because it will look at the 1st bit/byte(?) where it says what kind of file it is.

When it comes to bash script it is considered best practise to not include .sh at the end. By omitting it you basically create a command so those do not tend to even have an extension. And those commands could be made in bash but also in perl or python.

So looking at the actual name of the file might be misleading!

Linux has a command file to find out what a file is. Syntax file *

Some random samples:

xxxx.sql:    UTF-8 Unicode text, with very long lines
xxxx.sql.gz: gzip compressed data, was "xxxx.sql", from Unix, last modified:
Wed May 18 10:21:34 2011
yyyyy: ASCII text
iffffff: directory
ghgggg.tar: POSIX tar archive (GNU) perl script text executable

For a list of extensions Fuddledumpy's post can be used and files ending on .pl will more than likely be perl scripts but to make sure use file.

[#44706] Tuesday, May 24, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.

Total Points: 139
Total Questions: 102
Total Answers: 100

Location: Liechtenstein
Member since Mon, May 15, 2023
2 Weeks ago