I have several symlinks to other files in a directory. I want to convert these links into independent files.
Is there a command that does this?
|
|
|||
|
|
|
The first way that comes to my mind would be to copy all of the links to new files then delete all of the links.
Hopefully the files have some sort of common naming structure so you can use wildcarding and only run the commands once otherwise you might want to write a simple shell script |
|||
|
|
While Ignacio's is a good reply, I wanted to automate the process for every file that is a symlink in the current directory and subdirectories. This does the trick: find . -type l -exec cp \"{}\" \"{}.tmp$$\" \; -exec mv \"{}.tmp$$\" \"{}\" \; Hope this helps! |
|||
|
|