Skip to content

Weird recursive directory structure

Somehow, my system (Ubuntu WSL layer on Windows; so treat as exactly Ubuntu) went a bit crazy. For a directory (a git repo if it matters) /path/to/foo, running ls shows the git files ORIG_HEAD, index, and index.lock in there.

I tried to debug this by going cd .git, but an ls there showed me my same list of files as the parent!

I went as far as


before stopping checking the recursion.

A possibly related issue that managed to show up is that the .htaccess file there is read as a file by Emacs on Windows, a file by vi on Linux, but a directory by emacs and a directory by bash.

That means that my computer really thinks


is identical to


So, needless to say, Apache also craps out and says that it’s an invalid htaccess file …. though on an other machine (see: git repo) it runs just fine.




Tried nuking the directory via rm -rf and git clone-ing back, but the Apache problem persisted.

I removed the symlink to the directory via unlink:

~$ unlink public_html

then re-mounted it, making sure that there wasn’t a trailing space

~$ ln -s /mnt/c/Users/USER/pathto/repo /home/USER/public_html
User contributions licensed under: CC BY-SA
7 People found this is helpful