I want to launch sublime from a command line in Mac, using subl filename
. It seems to involve dealing with .bash_profile
. But I didn't locate the file. What steps to be taken?
First, navigate to a small folder in Terminal that you want ST to open and enter the following command: /Applications/Sublime\ Text. app/Contents/SharedSupport/bin/subl . NOTE: You may need to replace Sublime\ Text.
Go the users home directory. Check if the bash_profile is visible there or not. If not, press Command + Shift + . and bash_profile will be visible.
bash_profile : it is simply a text file that sits in your home directory on Unix systems. The “bash” part of the filename comes from the popular interactive shell. Bash ships with macOS, so if you've ever done any work in the Terminal you've already used it!
A typical install of OS X won't create a .bash_profile
for you. When you want to run functions from your command line, this is a must-have.
cd ~/
to go to your home foldertouch .bash_profile
to create your new file..bash_profile
with your favorite editor (or you can just type open -e .bash_profile
to open it in TextEdit.. .bash_profile
to reload .bash_profile
and update any functions you add. Notice the space between the two dots!If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With