Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute a .command file using Terminal?

Once I navigate to a certain directory that has a .command file in it, how do I execute that file using Terminal?

like image 579
Jack Humphries Avatar asked Sep 10 '11 01:09

Jack Humphries


People also ask

How do I run a .command in Terminal?

You can run both command line and graphical user interface (GUI) programs from the terminal. To execute commands: Type the command in the Terminal prompt. Press Enter to execute it.

How do I run a .command file in Terminal Mac?

In the Terminal app on your Mac, press the Up Arrow key. The last command you entered appears on the command line. Continue pressing the Up Arrow key until you see the command you want, then press Return.


1 Answers

If you want to execute it as if it was double-clicked in the Finder, you can use open foo.command. This will spawn a new Terminal window. If you want to execute it "inline", as it were, you can just use ./foo.command, as .command files must have the exec bit set in order to function.

like image 169
Lily Ballard Avatar answered Oct 03 '22 09:10

Lily Ballard