0

There is a folder e that I like to frequent. It is nested in /a/b/c/d/e. I was wondering if there was a way to create an alias for the folder e the same way the shell has created an alias for tilde (~).

By assigning the imagined alias @@ to /a/b/c/d/e, I would be able to use this in commands such as rm @@/testfile.

Any help is welcomed.

br1ttle
  • 11
  • 3
  • Something [like that](https://stackoverflow.com/a/39839346/7575111) perhaps? – NullDev Jan 14 '22 at 21:57
  • Stack Overflow is for programming questions. General Linux usage questions should be posted to [unix.se] or [su] instead. – John Kugelman Jan 14 '22 at 22:00
  • Let them know which shell in particular you're using. bash, zsh, fish, etc., have more options than plain sh. – John Kugelman Jan 14 '22 at 22:01
  • @NullDev this answers my question, thank you. For anyone who wants a similar workflow in zsh, you will need to enable the cd-able-vars option by adding `setopt cdablevars` to your zshrc and then defining the nested path with an export. Then, when using this new alias you will then need to preface the exported variable with `$` like so: `rm $gg/test.txt`. This will remove the nested test.txt file as required. – br1ttle Jan 16 '22 at 00:00

0 Answers0