Home > Software design >  Multi word aliasses (Ubuntu)
Multi word aliasses (Ubuntu)

Time:10-14

Is it possible to have a alias 'key' that consists of multiple words?

I tried (and without the ""):

nano ~/.bashrc
alias "git puhs"="git push"
source ~/.bashrc
>>bash: alias: `git puhs`: invalid alias name

Is this possible in any other way?

CodePudding user response:

Is it possible to have a alias 'key' that consists of multiple words?

No it is not possible. Alias name can't contain spaces. It is possible to "chain" aliases, by adding space on the previous alias value.

alias git="git "
alias puhs=push

For your sanity, do not do it that way and read https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases .

  • Related