I have a .dmg file and I want to hide its extension. So I do the usual and ⌘I, then check Hide extension. killall Finder just to be sure. I look and sure enough... the file extension is still there. So I use SetFile -a E myfile.dmg hoping that will work. It doesn't. Any ideas? Here's a picture just in case.enter image description here


OK, I found the issue. Apparently two options have to be set in order for any extension to disappear (except for .app). First you have to go into Finder's Preferences > Advanced. Untick Show all filename extensions. Then you tick Hide extension in the Get Info window for your file and the extension is hidden.

|improve this answer|||||
  • Works for me (under MacOS Sierra). – eldes Jan 20 '18 at 1:16

That's the "get info" window and not the Finder. The get info window will (in my experience) always show the extension.

Hiding the extension is for Finder views not the get info window.

|improve this answer|||||
  • I'm aware. I'm just showing my Get Info options in case I did something wrong. – atirit Apr 9 '16 at 16:28

Try just doing the basic thing by pressing enter and deleting the extension. The press get info to make sure the extension is still there.

Works on 10.11.4 Tested on OSX El Capitan 10.11.4

enter image description here

|improve this answer|||||
  • If you mean press Enter in regular Finder and then manually delete the extension, I tried that and it removes the extension entirely, as in it changes the file type from Disk Image to Raw Disk Image and doesn't show an extension in Get Info. Or maybe I'm not understanding your answer. :) – atirit Apr 9 '16 at 16:30
  • Thats funny, i did that and it stayed as a dmg but the extension was deleted from the filename. What version of osx are you using? – agillbraun Apr 10 '16 at 23:25
  • I'm using El Capitan. – atirit Apr 11 '16 at 2:05
  • thats what im using and it worked. Hmm im kinda lost here – agillbraun Apr 12 '16 at 2:47
  • Here's exactly what I'm doing as per your instructions. Go into Finder. Select my .dmg. Press enter (edit the filename), and press backspace until .dmg is gone. Then it gives me a warning popup. – atirit Apr 12 '16 at 2:57

You must log in to answer this question.

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