Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I started using DOS back before Windows, and ever since have taken it for granted that

  • Every file has a file extension, like .txt, .jpg, etc
  • That extension is always short (usually 3 letters)

I learned early that the extension is basically just a hint to the OS as to what the content type is. Eventually I got exposed to Mac and Linux, files with no extensions, etc. And of course I've seen shorter extensions, like .rb and .py.

I just noticed that markdown-formatted files can have the extension .markdown, and it made me wonder - how long can that extension be? If I make it .mycrazylongextensiontypewoohoo, will certain operating systems or programs choke on the file? Are extension names generally short just for convenience, or is this based on some limitation, legacy or current?

share|improve this question
File names like .VolumeIcon.icns will make your head spin :-) – Daniel Beck Jan 14 '11 at 16:54
@Daniel Beck But the extension only has 4 letters, so nothing strange there. – AndrejaKo Jan 14 '11 at 17:14
@AndrejaKo But there's two of them, and nothing else! – Daniel Beck Jan 14 '11 at 17:24
@Daniel Beck No, there's only one extension, which is marked by the first dot when reading from right to left. The rest is filename which contains a dot. It does look confusing. – AndrejaKo Jan 14 '11 at 18:47
@AndrejaKo And once again the web fails to convey irony. Sorry about that. – Daniel Beck Jan 15 '11 at 0:42
up vote 3 down vote accepted

Some operating systems limit the length of the extension (such as DOS and OS/2, to three characters) while others (such as Unix) do not. Some operating systems (for example RISC OS) do not use filename extensions. Unix accepts the separator dot as a legal character but does not give it a special recognition on the OS level.


Discussion here

share|improve this answer
+1 since I stole from your post, thanks Moab. – Not Kyle stop stalking me Jan 14 '11 at 17:02

For filesystems without the three-character extension limit, there's generally no limit on the length of the extension, only on the total length of the filename including the extension (e.g. 255 bytes for the ext3 filesystem used in Linux).

share|improve this answer

I wish I could give you a more in depth reason but I can't seem to find the sources I am looking for right now. However thinking back to the 8.3 file name standard in DOS I believe it was based on limitations with the FAT file system. This article will describe it better than I can. For Linux or Unix I believe you could have whatever size extension you want, since as Moab said the OS won't give it special recognition and thus can't choke on it.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .