How can I change symbolic links for targeted files? (move targeted files to place where are linked from)
I hope I'm clear.
Thank you in advance.
How can I change symbolic links for targeted files? (move targeted files to place where are linked from)
I hope I'm clear.
Thank you in advance.
If it's not in man ln
, then ln
definitely cannot do it.
But this should:
find /path/to/dir -type l -exec sh -c 'cp --remove-destination "$(readlink "{}")" "{}"' \;
The quotes are to take care of file names with spaces in them.
The -exec
calling into sh
is to evaluate $(readlink ...)
for each file.