Rant: How shell handles copying directories

As you guys know I love the unix shell I loved bash and recently switched my default shell to zsh. My "only" complaint about it is that when you command such as cp -r /mnt /home/user/tmp I always think that I'm taking the contents within mnt and copying them directly to tmp when actually it makes a directly called mnt "within" tmp I realized as I was writing this post that the correct command for the expected behavior is cp -r /mnt/* /home/user/tmp I decided to rant about this because the misconception cost me the loss of an entire drive that I'm now copying back from a backup because I wanted to delete the copied folder in tmp so imagine my current directory is /home/user/tmp and I meant to write rm -r mnt but instead I wrote rm -r /mnt and the command returned saying permission denied can't remove mnt but not before deleting everything in mnt.

1 Like

So, it's a PEBKAC error but you're bashing the shell, eh? :wink:

2 Likes

"Problem Exists Between Keyboard And Chair". Also known as PICNIC ─ "Problem In Chair, Not In Computer". :stuck_out_tongue:

2 Likes

LOL yeah I just searched it. And yes I'm bashing it pun intended. :smiley:

1 Like

LMAO IMO that's a better one.

1 Like

Can't make that pun. not allowed.
You're using zsh.
Nope, not allowed. :stuck_out_tongue:

6 Likes

Forum kindly sponsored by Bytemark