What are circular symlinks in Unix-like systems used for? [closed]
Asked Answered
R

2

5

I was browsing a directory on a Linux machine, and when doing a detailed listing I noticed that a link is pointing to itself, for example:

somelink -> /path/to/directory/somelink

I am wondering what is the reason for doing such a thing?

Receipt answered 1/10, 2012 at 20:46 Comment(0)
T
9

If the somelink is in /path/to/directory then this is an invalid symlink. If you try to access it, the filesystem will give you an error (probably something like too many levels of symbolic links*). It could have been a typo (or some other mistake) when it was created, or the symlink got moved somehow and ended up linking to itself.

Twoseater answered 1/10, 2012 at 20:50 Comment(0)
M
4

There's no good reason for a circular symlink. Most probably, it was created by accident.

Montherlant answered 1/10, 2012 at 21:9 Comment(2)
Thanks for confirming the answerReceipt
@A.B There is a good reason to have a circular symlink. See may answer over here.Danelle

© 2022 - 2024 — McMap. All rights reserved.