Running a command in a new Mac OS X Terminal window

We’ve been trying to figure out how to open multiple terminals on OSX and running different bash commands in each.

Most examples online show how to open a terminal or how to run a command in a home directory but in our Node app, we wanted to open two terminals in the current directory and execute two different npm run scripts

So what we did was

  1. Create a file in the root directory of the app called –
  2. Add the following lines in file to start a terminal and run a command
    ttab eval 'cd "/Users/You/Documents/WWW/myapp"; nodemon app.js'
    ttab eval 'cd "/Users/You/Documents/WWW/myapp"; gulp'
  3. Open the terminal and cd to the path of and run

Did that work for you?

Have an idea?

Let us transform your idea into a Scalable Product




1450 2nd St, Santa Monica, CA 90401