Home > Mobile >  How to escape the escape character in bash?
How to escape the escape character in bash?

Time:10-16

When I do an ls to my directory it shows a file with the name ''$'\033\033'. As I understood this was ASCII escape character pressed twice. I want to remove it with rm but I cannot escape the characters. Only through file manager I can delete it.

CodePudding user response:

Well, you should be able to use this command:

rm $'\033\033'

More info on how $'...' works can be found here.


Note that ls might display a file named $'\033\033' as ''$'\033\033'. Doesn't matter much though, rm ''$'\033\033' would also work fine as the two leading single quotes just form an empty string.

  • Related