Friday, January 9, 2015

Launch application from Mac terminal

This post will be useful for those who recently started using mac and working on Mac terminal. I have recently switched to MacBook Pro, thanks to my employer, using terminal for day to day activities. I have switched from windows command prompt to Mac Terminal and many things were new to me. One of it is launching any application from Terminal. 

I wanted to open any text file in the text editor of my choice. After some googling I found out the way to configure the terminal to configure your own command to open any application.

Here I am configuring custom command for my MAC terminal to open any file in text editor of my choice. Copy following command in your ~/.bash_profile

alias text=' open -a /Applications/TextWrangler.app '

So next time you open your terminal you should able to use 'text ' to open the same file in TextWrangler 

Configuring custom command for Mac Terminal