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:
Before
$ ll link
... link -> /path/to/target
After
$ 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?
debugfs
. Try to not cause too much damage...debugfs
is absolutely not the right tool to use here.