Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add Aliases to Bash Terminal from inside of VSC

Is there a way to add aliases to the bash terminal when using it from within Visual Studio Code?

like image 433
Nathan Stanford Avatar asked Nov 18 '17 18:11

Nathan Stanford


People also ask

Where do I put bash aliases?

Open the terminal and create any alias command you desire. If you open another session then the newly created alias will not be available. To make the alias persistent, add it to the . bash_aliases file.


1 Answers

I found the answer here https://gist.github.com/wzup/36b5159d8c580b827384

Take as an inspiration

# create a file C:\Users\[user]\.bashrc
# add this content
# add your onw aliases or changes these ones as you like
# to make a dot (.bashrs) file in windows, create a file ".bashrs." (without extention) and save. windows will save it as ".bashrc"

alias ls='ls -alh'
alias cdnginx='cd /c/nginx && ls'
alias cdmcga='cd /c/Users/[user]/sbox/node/mcga && ls'
alias cdfood9='cd /c/Users/[user]/sbox/node/food9 && ls'
alias cdmysql='cd /c/nginx/mysql/bin && ls'
alias cdsbox='cd /c/Users/[user]/sbox && ls'
alias cdangular='cd /c/Users/[user]/sbox/angularjs && ls'
alias cdmongobin='cd "/c/Program Files/MongoDB/Server/3.0/bin" && ls'
alias cdmongodata='cd /c/mongodb/data/db && ls'
alias sbrc='cd ~ && source .bashrc'
alias mydocs='cd ~/Documents'
like image 162
David Votrubec Avatar answered Oct 14 '22 21:10

David Votrubec