this post was submitted on 09 Sep 2024
273 points (80.8% liked)

linuxmemes

20707 readers
793 users here now

I use Arch btw


Sister communities:

Community rules

  1. Follow the site-wide rules and code of conduct
  2. Be civil
  3. Post Linux-related content
  4. No recent reposts

Please report posts and comments that break these rules!

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] bandwidthcrisis@lemmy.world 11 points 1 week ago (4 children)

Never create a file named "-rf *" unless you really plan on keeping it.

[–] dwt@feddit.org 17 points 1 week ago* (last edited 1 week ago) (2 children)
rm ./—rf\ \*

Am I missing something?

[–] bandwidthcrisis@lemmy.world 12 points 1 week ago

I'm not sure that you belong in this thread :)

[–] one_knight_scripting@lemmy.world 3 points 1 week ago* (last edited 1 week ago) (2 children)

I'm not going to try it but... rm "./-rf *" would do the same? rm "./-rf \*" maybe?

[–] dwt@feddit.org 3 points 1 week ago (1 children)

Couldn’t get single quotes to type on my phone, but best to always use them for problems like that, to completely get rid of shell interference.

I always forget about the single quotes.

[–] dwt@feddit.org 1 points 1 week ago

If you do want to try, just start a docker container and try inside there. That should negate all risk

[–] RecluseRamble@lemmy.dbzer0.com 3 points 1 week ago* (last edited 1 week ago) (2 children)

I've been using Linux as my main driver for a couple of years now but I didn't know the list of reserved file name characters is so short.

I didn't believe '*' is allowed. That alone is so error-prone, it's insane. Backslash is allowed too - how do you escape that? Sometimes I think they giggled while writing the specs.

[–] Revan343@lemmy.ca 3 points 1 week ago

Backslash is allowed too - how do you escape that?

It's backslashes all the way down

Just use double backslashes for each backslash

[–] bitchkat@lemmy.world 3 points 1 week ago
[–] crmsnbleyd@sopuli.xyz 3 points 1 week ago

if you use fish you can tab-cycle tour way to the file