I have multiple files starting with "?" that were mistakenly created. For a file "?" (a single character, no extension), I tried:rm ? rm \? rm ./? rm '?' (and combination of these).
All of them return "rm: cannot remove ‘?’: No such file or directory".
Please teach me how to delete the file.
[UPDATE]
The files appear as "?" by ls. However with -b. The file named ? turns out to be \274 and the other file ??Vk???8HU?^q???M????P??6?FeF?$? turns out to be \305\377Vk\21.... Now I can remove them. I appreciate the help from the community.
>Solution :
rm '?' should do the trick.
? Is a glob pattern, matching a single character. So rm ? and rm ./? would remove files with any single character as their name.
But, you potentially have a more complex name (which can’t be displayed).
You can show the special characters in C-Style escaping using ls -b.