Let's say I want to create an alias called ss
for the command sudo -s
. But ss
is already an existing command, so I want to create another alias called sst
for the command ss
.
If using just the normal command names, this is not possible, since aliases:
- Are not set in a way that respects the order, and
- Reference other aliases, instead of only referencing commands
So if I try the following:
alias sst='ss'
alias ss='sudo -s'
Running the command sst
results in running sudo -s
, which is not my intention.
How can this be done?
s
as you seem to be adverse to typing an extra character to have an alias not conflict with existing command. It is only single letter and is not in use. – Feb 26 '21 at 16:04s
, but this was more for example sake. Also, let's say I wanted another sudo alias (sudo -v
for example). Then maybe it's easier to remember it'sss
andsv
. – Artur Meinild Feb 26 '21 at 16:07command ss
or\ss
as the alias definition would be enough – muru Feb 26 '21 at 16:11