Signup/Sign In
Ask Question
Not satisfied by the Answer? Still looking for a better solution?

How can I create an alias synonym?

I have an alias pwd

How can I create another alias that is a synonym for it?

For example I have
alias cd1='cd ~/dir1'


I want a second alias cd01 that points to the same place but I don't want to also have:
alias cd01='cd ~/dir1'
in case /dir1 changes
by

1 Answer

Kajalsi45d
It works in both bash and zsh.
$ alias cd1='cd /'
$ alias cd01=cd1
$ cd01; pwd
/
# now, to change cd1
$ alias cd1='cd /etc'
$ cd01; pwd
/etc

Login / Signup to Answer the Question.