If you'r using
alias -g ,,=".." is what you need, but this will cause ",," to be expanded everywhere, not only when used with
-g flag is present, define a global alias; global aliases are expanded even if they do not occur in command position.
If restricted to
bash (as the question is tagged with bash), read the following:
This is a pure-alias solution, as requested, however this will do more than required possibly frustrating the user (see the warning at the end of my post).
If the last character of the alias value is a blank, then the next command word following the alias is also checked for alias expansion.
Therefore it's enough to alias
cd with an extra space (to allow expanding of its next argument) and then alias
... See that
alias cd='cd '
gives exactly what you need.
Note that this is correct not only for
bash (and its
alias implementation), but all POSIX-compilant shells. Quoting an example from
man 1p alias (the manual does not describe this feature explicitly, only through an example):
Set up nohup so that it can deal with an argument that is itself an alias name:
alias nohup="nohup "
As @PeterCordes writes in his comment, it will automatically cause other aliases to expand when written after
cd. It may require you to write
cd \grep if you want to change directory to one named
grep but your
grep is an alias for
grep --color=auto. Without the backslash,
cd will report "too many arguments" error (you can't
cd to two directories at once)!.