Matt Stenson

This is the personal site of Matt Stenson. I'm a programmer, nerd, mountain biker, dirt biker and outdoors enthusiest. I'll blog about different stuff here. I like open software and privacy focused tools.

Open File With App From MacOS Terminal

Reading Time: 1 min

Sometimes I like to open up a text file in a robust gui text editor on my mac while I am working in the terminal. Navigating to the same location in finder and then opening the file is just a pain. So after a little googling I discovered the open command. Here’s an example of when I need to edit my known_hosts file.

sudo open -a TextWrangler /Users/myuser/.ssh/known_hosts

This example used the -a switch to specify a specific application to open the file with. You can also let MacOS use the default app instead.


See Also