Post #2644171
2026-05-17 16:21 UTC
By default bash will only expand an alias if it’s the first argument of the command (that is, the command itself).
It’s probably not intended to use aliases this way, and there are probably better options for you.
However, there is a little trick you can do. If the alias command ends in a space, then bash will also check the next argument:
alias cd='cd '
Notice the trailing space after ‘cd’ in the alias definition.
alias docs='/media/docs'
then, cd docs should work the way you expect.
Replies (1)
-
@kibiz0r@midwest.social 2026-05-17 23:55
Cursed knowledge.