我有一个目录树,该目录树有一堆符号链接到/home
... 下的文件,但是,我已经移动/home
到/mnt/home
并且需要一种“重新链接”所有符号链接的方法。是否存在这样的功能,或者我需要编写脚本来做到这一点?
例如,我有如下内容:
[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
我想要一个将找到所有符号链接并重新链接到相同位置但在下面/mnt/home
而不是下面的命令/home
是否存在这样的命令?