Accessing a folder that I can't "name" in the shell

I have a stubborn folder that someone must have created accidentally and that has persisted all this time. I can see it with:

# find /var/www/html -maxdepth 1 -type d

which gives me:

/var/www/html
/var/www/html/files
/var/www/html/.?

unfortunately the question mark there is not the actual character ?, it merely seems to denote that there is no proper glyph and/or translation for that character. So something like rmdir is out of the question. My system has UTF-8 as the default locale as so many modern Ubuntu systems, but admittedly the folder in question may have originated on a RHEL or CentOS box (tared up and unpacked).

# env|grep LANG
LANG=en_US.UTF-8

When trying to cd .\? (as mentioned before it is not actually ?) I get auto-corrected to . by bash and actually end up in /var/www/html/. for some reason. Now if I can't "name" this folder usefully, I cannot access it in any way. How can I get rid of it without putting the whole system in jeopardy?

Now I installed detox already but that only seems to act on files, not folders, according to its documentation and besides it still requires that I be able to name the object somehow to do something with it.


A few suggestions, first try using tab completion

cd /var/www

rm -rf ./.TabTab

Or use find

cd /var/www
find -maxdepth 1 -type d -exec rm -ri '{}' \;

If that fails, try running fsck (from a live CD).

Post any error messages or odd behavior you get


rm -i * makes rm prompt for confirmation of any file. Just press n for all but that one and press y for the one you want removed.

You can also guess the amount of chars with rm -i .??? for 3 chars (so you do not risc pressing y once too many).


If you have only this two directories

/var/www/html/files
/var/www/html/.?

under /var/www/html/, you can remove the one not named files with the command

find . -mindepth 1 -maxdepth 1 ! -name files -exec rm -rf {} \;