Post #2643825
2026-05-17 16:11 UTC
alias is for aliasing commands. If you want to “alias“ arguments, use shell/environment variables.
$ docs=/media/docs
$ cd $docs
Replies (1)
-
@teawrecks@sopuli.xyz 2026-05-17 19:04
It is worth acknowledging that this probably seems unintuitive to a new user. Makes it look like the shell has two different aliasing systems. It makes sense the more familiar you are with bash, though. If you ever tried to cd /some/other/path-with-docs/in/the/string you’d end up accidentally running cd /some/other/path-with-/media/docs/in/the/string. Which would be confusing at best, or a security issue at worst. Better to see that $ in the cmd and know you’re injecting a var’s value.