As was mentioned in the question here, the open command in 10.6 now has an args flag, so you can call:

open -n ./AppName.app --args -AppCommandLineArg

🌐
Apple Support
support.apple.com › guide › terminal › execute-commands-and-run-tools-apdb66b5242-0d18-49fc-9c47-a2498b7c91d5 › mac
Execute commands and run tools in Terminal on Mac - Apple Support
You can use the command-line ... for low-level UNIX tools and APIs. See Reading UNIX Manual Pages on the Apple Developer website. ... Go to the Terminal app on your Mac....
Discussions

How do I run my C program in Mac Terminal?
To compile a file make sure you are in the directory of the file first: cd directory/path/to/file Then to compile the code, use this: gcc filename.c -o executablename To run the app from the terminal ./executablename More on reddit.com
🌐 r/learnprogramming
11
13
July 1, 2013
How to use terminal and commands on mac
Here’s a good primer: https://www.freecodecamp.org/news/command-line-for-beginners/ More on reddit.com
🌐 r/MacOS
110
94
May 8, 2023
How to create a keyboard shortcut to run file in terminal?
To map, type ctrl+k, ctrl+s. Type one of the commands, right-click, choose change keybinding, enter whatever you want the binding to be. More on reddit.com
🌐 r/vscode
6
14
June 15, 2019
How to run Javascript on a mac?
Create an HTML file, load your JS in it, open the HTML file in your browser? More on reddit.com
🌐 r/javascript
28
7
December 27, 2016
🌐
Wikihow
wikihow.com › computers and electronics › operating systems › mac › how to open apps in terminal on mac: step-by-step guide
How to Open Apps in Terminal on Mac: Step-by-Step Guide
March 2, 2026 - Learn how to launch apps using your Mac's command lineYour Mac's Terminal app gives you a text-based Unix command line inside the macOS environment. You can use the Terminal to run applications or open files in the program of your choice....
🌐
Mac Install Guide
mac.install.guide › terminal
Mac Terminal · Command Line Guide · 2026 - Mac Install Guide
July 18, 2021 - To run commands in the Mac Terminal, or execute programs on the command line (phrases that mean the same thing), you'll type commands at the Terminal prompt and then press the Enter key (also known as Return).
🌐
Apple
support.apple.com › en-ca › guide › terminal › apdb66b5242-0d18-49fc-9c47-a2498b7c91d5 › mac
Execute commands and run tools in Terminal on Mac - Apple Support (CA)
For example, to run the ls command in the current user’s home folder, enter the following at the command prompt, then press Return: ... To run a command in the current user’s home folder, precede it with the folder specifier.
Find elsewhere
🌐
Mac Issues
macissues.com › 2015 › 02 › 06 › how-to-launch-os-x-apps-via-the-terminal
How to launch OS X apps via the Terminal - MacIssues
June 2, 2015 - macissues.com is available for purchase. Get in touch to discuss the possibilities!
Top answer
1 of 2
4

I recommend you use:

alias atom="open -a Atom\ Nightly"

The open -a $APPNAME command is smart about finding GUI apps based on their user-visible name.

macOS GUI apps are packaged as ".app bundles" or "packages", which are actually special directory hierarchies. A traditional Unix shell like bash or zsh expect the file you invoke to be executable; either a shell script or an executable machine code binary file; you can't execute a directory. So if you want to invoke a GUI app from the command line, you must invoke its actual executable buried inside the .app bundle, which would usually be something like this:

/Applications/Atom\ Nightly.app/Contents/MacOS/Atom\ Nightly

The reason you were getting that permission denied error was you were asking your shell to execute a directory, which is not executable (the "x" permissions bit on directories means it's traversable, but that's beyond the scope of this question).

Note that launching GUI apps from a shell only works when the shell lives inside a GUI session, such as a shell running within a terminal emulator app. It doesn't work from a shell that's not associated with any GUI session, such as when you've SSH'd into the Mac from some other machine.

2 of 2
0

Why not use Spotlight?
Cmd/Space, start to type, hit Return when the correct name is selected [which you can do with arrows if you don't want to click.] If you don't have many things with 'atom' in the name, you're probably down to 4 or 5 keystrokes to open it from anywhere in the OS.

I don't have Atom Nightly, but here's an example for FaceTime, which everyone has. 5 keystrokes from start to finish, Cmd/Space, F, A, C, Return.

No pre-programming or aliases required. Using the system for what it's made for, rather than constructing elaborate hacks which take longer & need doing for every app.

🌐
Apple Support
support.apple.com › guide › terminal › open-or-quit-terminal-apd5265185d-f365-44cb-8b09-71a064a42125 › mac
Open or quit Terminal on Mac - Apple Support
This indicates that the user named michael is logged in to a computer named MacBook-Pro, and the current folder is his home folder, indicated by the tilde (~). ... Click the Launchpad icon in the Dock, type Terminal in the search field, then click Terminal. In the Finder , open the ...
🌐
AppleToolBox
appletoolbox.com › home › macos: how to launch app from terminal
macOS: How to Launch App from Terminal - AppleToolBox
September 14, 2022 - If you’re already in the Terminal, for instance, it might make sense to simply open an app from there. Below we’ll go into how to open apps on the Mac from the Terminal. ... Click on the Go menu at the top of the screen. (You might have to click an empty spot on the desktop to make Go appear if you’re using another program.)
🌐
OS X Daily
osxdaily.com › home › how to launch gui applications from the terminal
How to Launch GUI Applications from the Terminal - OS X Daily
October 21, 2022 - […] application in Mac OS X with a little command line magic. Using the ‘open’ command to launch GUI apps from the Terminal, we can run a new instance of any app, even if it is already […]
🌐
Juan Cruz Viotti
jviotti.com › 2022 › 11 › 28 › launching-macos-applications-from-the-command-line.html
Launching macOS applications from the command-line
November 28, 2022 - When directly running the application’s executable, ps(1) allows us to confirm that the shell owns the application process. In my setup, the application’s parent process id (PPID) equals the process id (PID) of my shell: $ ps -f UID PID PPID C STIME TTY TIME CMD ... 501 38133 747 0 8:42PM ttys005 0:00.31 -zsh 501 38343 38133 0 8:42PM ttys005 0:00.43 /System/Applications/Calculator.app/Contents/MacOS/Calculator ...