...making Linux just a little more fun!

### Find circular simlinks

Britto I [brittocan at gmail.com]
Fri, 24 Nov 2006 16:57:13 +0530

Hi Folks!

Some where in the directory structure there might be the circular symlinks ie the softlinks made to the parent directory

Say..

           localhost]# pwd

           /usr/local/test

           localhost]# ln -s .. cirlink

           localhost]#  ls -l cirlink

                     cirlink -> ..

I want to find that particular circular or recursive link

Thanx in Advance.. Britto

Top Back

Thomas Adam [thomas.adam22 at gmail.com]
Fri, 24 Nov 2006 11:40:38 +0000

On Fri, 24 Nov 2006 16:57:13 +0530 "Britto I" <brittocan@gmail.com> wrote:

    > Hi Folks!
    >
    >
    >    Some where in the directory structure there might be the circular
    > symlinks ie the softlinks made to the parent directory
    >
    >    Say..
    >
    >        localhost]# pwd
    >
    >        /usr/local/test
    >
    >        localhost]# ln -s .. cirlink
    >
    >        localhost]#  ls -l cirlink
    >
    >                  cirlink -> ..
    >
    >
    >     I want to find that particular circular or recursive link

    man readlink
    man symlinks

You might have to install the latter of the two suggestions above. You can also do this using find(1) but there's no point reinventing the wheel.

-- Thomas Adam

Top Back