I have a directory tree which has a bunch of symbolic links to files under /home
... however, I have moved /home
to /mnt/home
and need a way to "relink" all of the symlinks. Does such functionality exist or do I need to write a script to do so?
As an example, I have something like the following:
[root@trees ~]# ls -l /mnt/home/someone/something
total 4264
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 a -> /home/someone/someotherthing/a
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 b -> /home/someone/someotherthing/b
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 c -> /home/someone/someotherthing/c
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 d -> /home/someone/someotherthing/d
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 e -> /home/someone/someotherthing/e
/mnt/home/someone/something/subdir:
total 4264
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 a -> /home/someone/someotherthing/subdir/a
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 b -> /home/someone/someotherthing/subdir/b
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 c -> /home/someone/someotherthing/subdir/c
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 d -> /home/someone/someotherthing/subdir/d
lrwxrwxrwx 1 jnet www-data 55 2011-08-07 13:50 e -> /home/someone/someotherthing/subdir/e
I want a command which will find all the symlinks and relink to the same places but underneath /mnt/home
instead of /home
Does such a command exist?