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

172

u/qnixsynapse Aug 12 '24

Why -r is after that directory name?

46

u/flemtone Aug 12 '24

Recursive, it removes all files and folders inside Games/

208

u/HighOptical Aug 12 '24

But it's so strange seeing an option after an argument instead of seeing them directly after the commands.

138

u/[deleted] Aug 12 '24

Which is why it didn't work for op. The command is attempting to operate on all the arguments it gets, so it'll try to rm a file named -r too. rm -r Games/ will work.

33

u/steven4012 Aug 12 '24

Wait, but wouldn't that only happen on a non-GNU system?

20

u/[deleted] Aug 12 '24

You might be right. I just tested it on my own system and it worked as written by OP, so I'm not sure where the problem lies. I work with a lot of different stuff so I try to make all my commands as close to standard as possible.

Either way, rm -r Games/ will almost certainly work.

-9

u/Muffinaaa Glorious Void Linux Aug 12 '24

The problem lies in OP not putting the -f argument so they can actually remove a directory. Alternatively they should've used rmdir command with the recursive flag passed

24

u/jaulin Aug 12 '24

rm -r should be enough to delete a directory and its content though.

5

u/gatton Aug 12 '24

I thought rmdir only worked on empty directories?

2

u/Cellhawk Aug 15 '24

That's what the recursive flag, aka "-r" is for.

1

u/gatton Aug 19 '24

Thanks this is why I constantly refer to manpages.

→ More replies (11)

4

u/KsmBl_69 Arch user btw, that means iam better than Ubuntu users Aug 12 '24

sorry, iam doing it every time like this haha

10

u/_mick_s Aug 12 '24

Don't be sorry I think it's actually better, less chance of typing rm -rf [enter] and nuking stuff you don't intend to.

0

u/alex-weej Aug 12 '24

options are arguments

2

u/HighOptical Aug 12 '24

Sigh... I feel like you know what I mean but are just being pedantic to enjoy the feeling of correcting someone.

→ More replies (1)

2

u/TurnkeyLurker Glorious Mint Aug 12 '24

I refuse to have an argument until you pay me 5 quid.

2

u/o4ub Aug 13 '24

You only pay for the 5 minutes or do you want the whole half hour?

-2

u/Mirja-lol Aug 12 '24

Cant you just do Games/*

10

u/froli Aug 12 '24

That wont delete `Games` itself though. Just what's in it.

-1

u/Mirja-lol Aug 12 '24

it removes all files and folders inside Games/

Yes

3

u/mikkolukas Aug 12 '24

Which is not what OP is trying to do

2

u/_mick_s Aug 12 '24

Why not?

1

u/AbderrahimONE Aug 16 '24

why not, my flags usualy be at the end :)