How to maintain symlinks in linux file manager?
Posted
by
MountainX
on Ask Ubuntu
See other posts from Ask Ubuntu
or by MountainX
Published on 2012-03-29T22:26:29Z
Indexed on
2012/03/30
5:42 UTC
Read the original article
Hit count: 320
I want to use symlinks extensively. However, if I move the target file, the symlink becomes broken (unlike on Windows). That's not acceptable to me, so I either need a solution or I won't be able to use symlinks the way I wish to.
Is there a solution that will work with Dolphin file manager?
A command line solution is described on commandlinefu. In summary, it is something like one of these:
lmv(){for a in ${@:1:$(expr $#-1)};do [ -e "$a" -a -e "${@:$#:1}" ] && mv "$a";"${@:$#:1}" && ln -s "${@:$#:1}"/"$(basename "$a")";"$(dirname "$a")";done}
lmv(){for a in ${@:1:$(expr $#-1)};do [ -e "$a" -a -e "${@:$#}" ] && mv "$a";"${@:$#}" && ln -s "${@:$#}"/"$(basename "$a")";"$(dirname "$a")";done}
But about half the time I'm using a file manager (Dolphin), so I need a complete solution to this problem. Is a solution available for a GUI file manager?
EDIT: The context of this question is that I'm searching for an alternative to hardlinks. I previously asked this question about the pitfalls of hardlinks.
© Ask Ubuntu or respective owner