The difference between .command, .tool, and .sh file extensions

command linescriptterminaluti

I saw a couple of questions about executing command line scripts? I saw that the .command and .tool extensions were mentioned. I have always used .sh. What is the difference between these different scripts? Do some extensions allow for different commands?

Best Answer

  • .command - (Terminal shell script) Specifically associates a shell script with Terminal. Sometimes referred to as a "Terminal File."
  • .tool - (Terminal shell script) Same as the ".command" file extension.
  • .sh - (Shell Script) A basic shell script that is associated with Xcode 4.1.

Programmatically, I'm sure the difference between the first two (.command vs. .tool) are subtle, while the third is essentially a simple, default shell script. And does in fact associate with Xcode 4.1.

enter image description here