8

If they do I'd love to learn the names of them and what they do.

muru
  • 197,895
  • 55
  • 485
  • 740
Zinux
  • 127
  • 2
    The use of filename extensions in Microsoft Windows is inherited from MS-DOS which in turn emulated CP/M which recognized files named '*.COM' as binary executables. That mechanism is handled by file attribute flags in Unix. – Thorbjørn Ravn Andersen Jan 24 '17 at 12:33
  • 2
    Funny that you call extensions "Windows filenames", since the only novelty Windows has introduced in their handling was trying very hard to hide them from the user. – Federico Poloni Jan 24 '17 at 14:36

2 Answers2

20

These are filename extensions, and many of them will be the same between Windows, Linux and MAC OS.

Most executables are not cross-platform, which means you will have to find Linux versions of executables. This includes extensions such as .com and .exe from Windows. Look into apt-get to learn about the recommended way to install software in Ubuntu.

Other extensions, such as .png, will be loaded by a Linux executable or script.

A clear example of this is that chromium is a browser available on both Linux and Windows. You can load any .html file on either of them, but you will have to run the proper executable for your platform.

You may be interested in learning more about file signatures, media types, file formats and more specifically, file headers.

earthmeLon
  • 11,247
  • 6
    Just to note, bin as a file extension isn't really anything common nor is it something registered by default. It's just often used as "binary data". I think what you were looking for was com for classic MS-DOS executables/commands. – Mario Jan 24 '17 at 10:09
  • note that programs are not required to have any filename extension (though they need to be executable, and be valid of course) – Florian Castellane Jan 24 '17 at 13:16
  • @Mario I think it is registered by default, actually. Case example, Florensia, is a game whose executable is (for some reason) named as a .bin. Certainly not common, though. – Kroltan Jan 24 '17 at 13:24
  • 1
    @Kroltan No, those are typically executed around some corners as part of some copy protection or anti cheating tools. By default you can't "run" bin files. – Mario Jan 25 '17 at 06:46
10

No. Unix/Linux did NOT make the same error as windows by building how a file is treated into the user-controlled filename (secrets.pdf.exe, anyone?). Sometimes, Unix/Linux users use file extensions to hint (to other humans) what the file is used for, but the system doesn't care what you call a file. Use the file command to see what Ubuntu thinks a file is used for.

waltinator
  • 36,399
  • 10
    "building how a file is treated into the user-controlled filename" - what about the user-controlled file contents? – Ark-kun Jan 24 '17 at 05:15
  • 1
    this is not entirely correct. Please read this this – phuclv Jan 24 '17 at 09:53
  • 1
    @dotancohen> I just tried making a png image named test.txt and clicking it in Dolphin, it correctly opened in gwenview. I don't know where you got your impression from… – spectras Jan 24 '17 at 11:31
  • 1
    @spectras: You're right! KDE once (maybe in the 3.x days) did open files based on filename, and there still is configuration for it in System Settings -> File Associations. I'm retracting my previous statement. – dotancohen Jan 24 '17 at 11:34
  • @dotancohen> sounds likely indeed, it's true KDE took a lot of inspiration from windows and slowly moved away from it year after year. – spectras Jan 24 '17 at 11:44
  • Indeed, on Linux you can't tell from the filename whether the email attachment is malicious. – OrangeDog Jan 24 '17 at 12:23
  • The difference here is that on Linux the "file extension" is part of the actual file name just like any other characters. Your file can be called e.g. test.txt.....,,,:::::txt.txt., On windows there's a separate extension part (.exe, .bat etc). On Windows you have to say *.txt, on Linux you can say *txt because . has no special meaning. – juzzlin Jan 24 '17 at 12:27
  • 10
    This answer is not correct in the sense that also on Linux the behavior regarding file extensions depends on the application. There is the filecommand, yes, but e.g. file open dialogs filter files by "extension". They don't inspect the file internals like file command. – juzzlin Jan 24 '17 at 12:38
  • 1
    Basing file handling on extensions is a property of desktop environments ONLY on Linux/Unix. Most of them aren’t really Unixy in any way, and this is just a result of them trying to imitate Windows/OSX. True Unix software, and by extension Linux software, doesn’t give a $hit about file endings, and only uses them as a fallback. So this answer is entirely correct. What’s wrong is what n00bs (includes KDE/Gnome/Mozilla and even many Linux kernel developers) consider to be Linux/Unix. –  Jan 24 '17 at 14:59
  • @user205301 on Windows the file extension is part of file name as well. The separate extension namespace only exists in DOS – phuclv Jan 24 '17 at 15:47