recursive directory loop
Why do some directories have recursive links?
grep reports them and appears smart enough to ignore them. |
usually by mistake
|
Can you show an example?
|
Code:
jim@HOME-HP:/usr/bin/X11# ls -al |
yes, it definitely looks like a mistake. The root cause is that the command ln -s <from> <to> will give different resuslt depending on the <from> (if it was a file or a dir) and depending on <to> if it exists or not and <to> is a dir or file.
usually creating link into a non-existing dir will give you surprising result. Using relative path may also lead to strange results (especially when the current working directory is not the one you need to use). I think that happened in your case. |
At least that's only a symbolic link and not a hard link causing an actual fault to be unravelled.
I also suspect the [ in /usr/bin/X11 is an error. |
Quote:
|
Quote:
Code:
ls -li Code:
[ginola@wopr LQ]$ date > one.txt |
from my perspective , the only advantage to use soft link into a directory is that you needn't type so many letter...
for example ln -s /home/user/2013/02/10/work /home/workfolder cd /home/workfolder |
Quote:
symbolic links are used for many purposes, not only shorten the path. For example you can easily change different versions of a file by only replacing the link. |
Actually, you can't make a hardlink to a directory - it is already set. The problem with making hard links to directories is that it makes fsck fail (the directory tree is no longer a tree).
A directory file can only have two links - one pointing to itself (.) and the one from its parent directory. During fsck, a symbolic link is treated as an ordinary file with data. Directories though must have a parent directory, and must have an entry for themselves. A parent directory must exist, and there can only be one parent directory. |
All times are GMT -5. The time now is 01:19 PM. |