This is probably a very simple thing but I can’t find an answer, possibly because I don’t know what terms to use in search.

How do I use an alias of a path with mv or cp? Or even cd?

In /etc/bash.bashrc I have: alias docs=‘/media/docs

cd docs Gives “No such file or directory”

Yet: docs Gives “Is directory”

With alias docs=‘cd /media/docs’ and by typing docs I get into the directory. Obviously I can’t use that alias with mv or cp though.

Maybe this isn’t even an intended use of alias but still. Why doesn’t it work?

you are viewing a single comment's thread
view the rest of the comments
[–] 2 points 5 months ago (4 children)

That sounds inconvenient. I use ~ all the time. $HOME should point to the same dir in most cases though

  • source
  • parent
  • hideshow 4 child comments
  • [–] [S] 1 point 5 months ago (3 children)

    Unfortunately $ also requires pressing the damned AltGr.

  • source
  • parent
  • hideshow 3 child comments