I want to do something like type sub
then enter, the current directory will open in terminal.
I saw some solution for something like this, but they require typing the dot character after the keyword, which is still long
I want to do something like type sub
then enter, the current directory will open in terminal.
I saw some solution for something like this, but they require typing the dot character after the keyword, which is still long
Assuming you are using bash
as shell: open/create the file .bashrc
in your home folder and insert a line with the content alias sub="subl ."
and restart your terminal.
Or you can type . ~/.bashrc
… I found that out some weeks ago. Saves the time restarting the terminal (and maybe losing the actual working path).
sorry, how to create .bashrc in home folder? Like open terminal, type cd home
then enter? then in create a file name .bashrc ?
ah i find out. My mac does have bash_profile file. I can write alias in it. Thanks
You can just write subl ~/.bashrc
, but as you already noticed OSX seems to use login shells by default. Therefore you should use .bash_profile
instead of .bashrc
on your system.