Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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

share|improve this question

2 Answers 2

up vote 2 down vote accepted

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
share|improve this answer

It should works. On my systems, I have:

alias ls='ls -F'
alias ll='ls -l'

That means ll is alias to ls -F -l. Have you tried your scenario out?

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.