this post was submitted on 17 Jun 2026
-9 points (26.3% liked)

Explain Like I'm Five

21449 readers
96 users here now

Simplifying Complexity, One Answer at a Time!

Rules

  1. Be respectful and inclusive.
  2. No harassment, hate speech, or trolling.
  3. Engage in constructive discussions.
  4. Share relevant content.
  5. Follow guidelines and moderators' instructions.
  6. Use appropriate language and tone.
  7. Report violations.
  8. Foster a continuous learning environment.

founded 3 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] redlemace@lemmy.world 3 points 11 hours ago* (last edited 11 hours ago) (1 children)

The $ is unquoted and so it's interpreted as a if variable name will follow. That does not happen (a literal string follows the $) so it casts an error

You probably are looking for this : rm -r 'folder'$'003'

The slash will cause the shell or interpret the next character literally (as as $ and not as variable indicator)

[–] BlackEco@lemmy.blackeco.com 7 points 11 hours ago (1 children)

You should wrap rm -r 'folder'\$'003' in backticks, because in my Lemmy client the backwards slash wasn't showing.

[–] LoveEspresso@retrofed.com 1 points 11 hours ago (2 children)
[–] Calfpupa@lemmy.ml 1 points 11 hours ago

You put an extra backslash in there, it should be rm -r "folder'\$'003"

[–] LoveEspresso@retrofed.com 1 points 11 hours ago (1 children)

After this, i gave the ls command, and it's showing up.

[–] Strider@lemmy.world 1 points 11 hours ago* (last edited 11 hours ago)

Did you try with bash autocomplete?

rm -r folder

And see how it spells it? Also you could wildcard depending on what you (don't) want to delete in the process.