I am using the touch command to try and create a file with the name "\?$*'KwaMe'*$?\" (quotation marks included as part of the file name). However when I type touch "\?$*'KwaMe'*$?\" in the Terminal, it doesn't give me the result I am expecting. How can I create this file?
You need to escape special characters with the backslash symbol (\).
This command will create a file named "\?$*'KwaMe'*$?\":
touch \"\\\?\$\*\'KwaMe\'\*\$\?\\\"
\, like this: \\, so that your shell does not interpret the backslashes from your filename as escape characters." and ', like this: \", \', so that your shell interprets the double quotes as part of the filename.$, like this: \$, otherwise your shell will think you're using a variable.? and *, like this: \?, \*, to prevent filename expansion.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With