this post was submitted on 17 Jun 2026
-11 points (28.0% liked)

Explain Like I'm Five

21449 readers
84 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
 
top 15 comments
sorted by: hot top controversial new old
[–] gravitas_deficiency@sh.itjust.works 5 points 1 day ago* (last edited 1 day ago) (1 children)

$ indicates that the string following is an env variable, but you just have a closing quote, so bash is confused.

If you want the literal character $ in your command, you must escape it: \$

Edit: afaik my answer does not change based on the fact that this is fish instead of bash or zsh. The $ is outside of the single quotes, and is thus being interpreted as an env var anchor.

[–] SpikesOtherDog@ani.social 1 points 1 day ago (2 children)

They are using fish, FYI. Not sure how much of a difference this makes.

[–] LoveEspresso@retrofed.com 0 points 1 day ago (1 children)
[–] Strider@lemmy.world 1 points 1 day ago

Of course. It could work totally different from bash.

To be fair I saw some cool fish stuff and thought about using it but when maintaining a few thousand servers with bash its not viable to load an alternative shell to all of them.

[–] LoveEspresso@retrofed.com 0 points 1 day ago (2 children)

The actual folder is 'folder'$'\003' .

[–] gravitas_deficiency@sh.itjust.works 7 points 1 day ago* (last edited 1 day ago) (1 children)

In that case, I think you want

rm -rf "'folder'\$'\\003'"

Note the double escape before 003, which will render to the character literal \

Alternatively, start typing

rm -rf \'fo

And then hit tab until fish autocompletes the directory you want to kill, and run it.

Side note: i would absolutely not tolerate directories named like that lol

[–] LoveEspresso@retrofed.com 2 points 1 day ago

Thanks for the tip.

[–] hemko@lemmy.dbzer0.com 4 points 1 day ago (1 children)

Is this some school task...? Why is there a folder with such a name 😅

[–] LoveEspresso@retrofed.com 3 points 1 day ago

Apparently yes. I'm learning things on my own.

[–] jerkface@lemmy.ca 3 points 1 day ago (1 children)

how did you decide which parts to quote..?

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

I simply copied down the commands in the lesson.

[–] jerkface@lemmy.ca 1 points 1 hour ago

might have been clearer to just link to that

[–] ratajs@thelemmy.club 2 points 1 day ago (1 children)

This syntax works for me on Bash and Zsh. Your shell might have a different way of writing escape sequences.

[–] LoveEspresso@retrofed.com 2 points 1 day ago (1 children)

Bash and Zsh are identical ??

[–] ratajs@thelemmy.club 1 points 23 hours ago

They are not identical, but more they are quite compatible, most of Bash syntax and built-in commands work on Zsh as well. From what I’ve heard, Fish differs from them a lot. I use primarily Zsh, but sometimes run Bash if I need it for something (before ** started working on Zsh, I used Bash globstar when I needed it, for example).