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?


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.

  • Luckily I've found the original files, so I can copy them a more sensible way. Thanks! – Mikey C Jul 24 '12 at 11:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.