I am trying to understand how the shell is interpreting emacs and Emacs, and where it finds the application.

I can launch emacs by running

emacs &


Emacs &

in the terminal, and it looks to me like it is the same application (which is not the emacs shipped with the OS, which is at /usr/bin/emacs, but another one which I have installed, almost certainly with emacsformacosx though I am not sure how to verify this information).


$ echo "$PATH"


which emacs




which emacs



Now if I look into the folder /Applications/Emacs.app/Contents/MacOS/, I only see Emacs but no emacs:

$ ls -1d /Applications/Emacs.app/Contents/MacOS/[eE]*

On the other hand, if I use find, I get a result emacs, but I don't understand where it comes from:

$ find /Applications/Emacs.app/Contents/MacOS/ emacs | grep emacs

but I don't see this last emacs in the folder, so where should I be looking?

(In addition, I don't understand exactly what find does, as it returns outputs without the string "emacs" in it, so I filtered them with grep).

One last remark.
Previously I had a typo in my PATH (which I set in my .profile): I had


(note the lower case "s" in "MacOs" at the end) instead of


But I did not get any error, not did it seem to make any difference to correct this type. Namely, even with the type, which emacs happily returned /Applications/Emacs.app/Contents/MacOs/emacs (with the typo) and which Emacs just as happily returned /Applications/Emacs.app/Contents/MacOs/Emacs (again with the type).

So this suggests that emacs or Emacs are found somewhere else.

  • 7
    On MacOS, file names are case-insensitive by default. Perhaps that's what's causing this?
    – legoscia
    Commented Jun 13, 2019 at 11:28
  • You've got to be kidding... Indeed, eMacs for example also works. I am still wondering about the emacs appearing in the result of find, and the other mystery about the typo not seeming to have any impact.
    – Antoine
    Commented Jun 13, 2019 at 14:22
  • 2
    Where were you when you typed that find command? I think you actually wanted something like find /Applications/Emacs.app/Contents/MacOS/ -name emacs (note the -name argument). If there was an emacs in the current directory when you ran the find command it does indeed print out emacs at the end given your command (at least on Linux it does). Commented Jun 17, 2019 at 12:15
  • I wish I remembered exactly where I ran the command. I just tried from within /usr/bin, which contains the system's emacs, but the find command doesn't output anything. Nice try, though.
    – Antoine
    Commented Jun 18, 2019 at 13:06
  • What exactly is your question here? I didn't want to close it as unclear because this would just bounce it back to SO, but please edit your question down to what you actually want to know (ideally by considering that you now already know that macOS doesn't care so much about upper/lowercase in filenames by default, so some of the issues in your question are already explained).
    – nohillside
    Commented Jun 26, 2019 at 3:32

1 Answer 1


The default install of macOS uses a case-insensitive file system. This is true of both HFS+ installations of macOS 10.12 (Sierra) and earlier, as well as APFS installation of macOS 10.13 (High Sierra) and later.

The use of a case-insensitive file systems means that files and folders can be reached with any mix of case in the name. The name used to create the file/folder is used verbatim when displaying the name of the file, but when you need to access it, you can mix it up:

$ touch myTeSt
$ ls
$ rm mytest

I.e. the case is displayed as "myTeSt" when running ls, but you can delete the file using "mytest", "MYTEST" or any variation thereof.

Naturally, this also extends to programs that you can then start using any variation of case inside the program name.

Note that it is possible to install macOS on a case-sensitive file system, where this does not apply, however it is not the default install.

You must log in to answer this question.

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