Can’t unhide filename extensions

finder

I have a folder containing a bunch of jpeg files and currently all of the filename extensions (.jpg) are hidden. How can I unhide all the extensions in this folder?

When I do a "Get Info" on any individual file, I can see that the "Hide extension" checkbox is checked but it's grayed out (i.e. disabled) so I can't change it. I've gone to Finder's Advanced Preferences and checked "Show all filename extensions" but that hasn't made a difference. Also, I do have read and write privileges on the files. How do I do this?

Best Answer

After doing some research I found the answer. You have to run this command:

SetFile -a e <filename>

In effect, this says "Set the file extension attribute (-a e) so that the extension is not hidden. If the extension were not hidden and you wanted to hide it, you would substitute "E" for "e".

To see all of a file's attributes, run this command:

GetFileInfo <filename>

A description of all the attributes can be found here.