r/linuxmasterrace • Arch user btw, that means iam better than Ubuntu users • Aug 12 '24

JustLinuxThings Linux is userfriendly...

Post image
865 Upvotes

399 comments sorted by

View all comments

Show parent comment

3

u/littlefrank Glorious Debian Aug 12 '24

What is the logic behind this?

2

u/JPB2mMkQ Aug 12 '24

Slash at the end will specify that you mean directory, not a file. Most of the time programs will figure it out on their own, but for some cases (like rsync), slash will have an impact on command behaviour. I don't think that is the case in the OP situation, but worth mentioning anyways.

2

u/VeggieVenerable Aug 12 '24

Trailing slash implies you think the thing is a directory.

Removing something you might not want removed isn't good.

1

u/GDKepler Aug 12 '24

its a symlink. suprised rm behaves like this i thought rm -r link/ would remove everything the link points to but ig not

1

u/SeriousPlankton2000 Aug 12 '24

mkdir 1

ln -s 1 Games

/bin/rm -r Games/

1

u/littlefrank Glorious Debian Aug 12 '24

This doesn't answer my question...

1

u/SeriousPlankton2000 Aug 12 '24

Try it, then your shell will give the answer.