How to launch Sublime text editor from terminal in Macbook ?

As you all know, Sublime is one of the famous and lite weight text editor and can be used for application development for almost every programming language available today.
For VS Code to launch editor from terminal, you can use code from terminal.
But for Sublime there is no direct method. To achieve this in sublime we can achieve it in 2 methods I believe. Lets see one by one

Using Soft Link

After creating soft link just type sublime in your terminal and sublime open.
  
ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/sublime

Using alias

Add alias like below in your .bashrc or ~/.bash_profile files

subl='/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl'

then do load the changes with source

source ~/.bashrc

Hope this helps.
Thanks
Raja

Comments

Popular posts from this blog

grep: unknown device method

Uploading files to FTP/SFTP using CURL

How to find outgoing IP in Linux ?