MacOS – Visible Hidden Folder Disappears After Renaming it to [Dot Underscore]

findermacosrename

I was temporarily changing the name of a folder before moving it. The name I randomly chose was "._". The folder immediately disappeared and Finder would not allow me to undo the operation. (I know; bad convention, but it was going to be temporary, so didn't think it would be an issue.)

*** NOTE: Viewing invisible files/folders was already turned on before this incident. *** (I can still see hidden files except THIS one.)

Looking through Finder, the folder was no longer visible. It was also not indexable (of course) by Spotlight Search.

So, two questions…

  1. Primarily, "How do I get it back?"
  2. Why did this happen? Is "._" a reserved system name? Is this repeatable?

UPDATE: Language addressing $ cd into the wrong working directory was removed from OP to reduce ambiguity and verbosity. Corrected solution moved to answer section.

Best Answer

All files and directories starting with . are Finder hidden files. System reserved dot directories are . for current directory and .. for parent directory. This is carried on from OS X Unix heritage.

For your file, there is a chance that you have an extra space after the _ or some unprintable character. Try mv ._ then hit TAB to find out if it will perform a completion on the name. If it does then continue typing the new name you desire. Note that you might need to hit TAB twice or more until you get that particular file name displayed in case you had other files that start with ._ in that directory.

Note that files and directories starting with . can be viewed in Finder upon desire and that you can search for on ASK DIFFERENT. They are called hidden files.