27

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
[-] clmbmb@lemmy.dbzer0.com 4 points 2 days ago

New users should try to take a little time to read the basics, not suppose things then ask strangers in the internet.

[-] teawrecks@sopuli.xyz 3 points 1 day ago

This was an unknown unknown for OP. Again, it's completely fair for a new user to see the alias feature, think "ah, that's built for aliasing one thing to another, let me try it for this directory name", and be confused when it doesn't work. OP can't know what they don't know.

And the open source community is just that, a community. Asking questions in forums is the accepted practice. And "basic" is hard to define. What is basic for you isn't basic for someone else, in the same way that what is basic for someone else isn't basic to you.

[-] Black616Angel@discuss.tchncs.de 4 points 2 days ago

Wow, you are unable to even read the post you reply under.
They said that they don't know, what terms to use for their search.

[-] clmbmb@lemmy.dbzer0.com 2 points 2 days ago

Wow, I replied to a reply, not to the original poster. Anyway, I still stand by my idea.

this post was submitted on 17 May 2026
27 points (100.0% liked)

Linux

65378 readers
135 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 7 years ago
MODERATORS