I want to make custom file extension for Linux and now, I want to know where are file extensions defined?
Asked
Active
Viewed 80 times
-5
-
Waltinator's answer is correct. Are you perhaps reffering to file-types rather than extensions? Perhaps you want the`file` command to report a file-type and version. `file` parses a file for anything it could recognize and then report the filetype such as `ELF 64-bit LSB pie executable`, `PDF document version 1.4`, or `ISO Media, MP4 Base Media v1 [ISO 14496-12:2003]`. Or perhaps you're interested in the `mimetype` of a file (which is very similar to `file`). – Stewart Jan 23 '21 at 20:55
-
Possibly useful: https://unix.stackexchange.com/q/151008/315749 – fra-san Jan 23 '21 at 21:02
-
Linux (the kernel) and Gnu/Linux (the operating system) and other Unixes, don't have file extensions (Nor nose Microsoft NT (the OS that MS-Windows runs on)). However many file-manages do. Therefore the configuration of the file-manager will be the place to look. (also the `file` command.) – ctrl-alt-delor Jan 23 '21 at 22:43
-
Wikipedia "List of file formats" shows about 1500 or more known extensions. For a custom format, you should probably be aware of the major usage in other OS and fields, in case you ever want to go global. For example, you don't want to collide with something known to gamers all over the world, even if there is no common platform. – Paul_Pedant Jan 23 '21 at 23:38
2 Answers
2
File extensions are not special the way they are in Windows (anybody else remember evil.pdf.exe?), so they're not "defined" anywhere.
There are conventions, like .c for C source, and some programs change behavior based on what's after the final ".".
A Unix/Linux filename can contain any character EXCEPT "/" and NUL (0x00).
What are you trying to achieve?
waltinator
- 4,439
- 1
- 16
- 21
0
Linux (the kernel) and Gnu/Linux (the operating system) and other Unixes, don't have file extensions (Nor dose Microsoft's NT (the OS that MS-Windows runs on)). However many file-manages do. Therefore the configuration of the file-manager will be the place to look. (also the file command.)
ctrl-alt-delor
- 27,473
- 9
- 58
- 102