What happens when you name a folder as ".."?

Instead of moving a folder to parent directory, I renamed it as ".." using mv folder_name ... Do you have any solution to recover the folder or is it just deleted? (macos 12.4)

Asked By: yokus


It is not possible to create a directory or file named .. because this name is reserved for the parent directory of any directory.

So, the directory was not deleted, you just moved it to the parent, and this is why you don’t see it anymore in you current directory.

To move it back to its original place, run

mv ../folder_name .
Answered By: dr_
Categories: Answers Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.