I had folders with many symbolic links in them. Unfortunately after copying that around different filesystems, they've turned into plain text files with the link target as the contents. That is:
$ ll link ... link -> /path/to/target
$ cat link /path/to/target
What's the easiest way to restore this link? Perhaps a one-liner or a shell script.
Suppose I had hundreds of links like this, is there a way to restore them all, without manually running the fix on each one?