Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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.

share|improve this answer
    
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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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