1

Due to copying some files from Linux to Windows XP and then to Linux again, the metadata or whatever that turns some files into a symbolic link has been lost.

So for example I have a file called "example" which should be a symbolic link to '../example2' but instead is now just a text file saying '../example2'.

Is there a way of making these files back into the correct links again automatically, or will I have to go through each one with an ln command?

Mikey C
  • 39
  • 6

1 Answers1

2

I'm afraid you going to have to relink them. In future make sure you try and copy between like filesystems.

If you still have the original file system, you maybe able to script the ln command , but it may be more trouble than it's worth.

find / -type l -exec ls -l {} \;

will find all your symlinks.

user9517
  • 115,471
  • 20
  • 215
  • 297
The Unix Janitor
  • 2,458
  • 15
  • 13