Question: What is the most direct way to convert a symlink into a regular file (i.e. a copy of the symlink target)?

Suppose `filename` is a symlink to `target`. The obvious procedure to turn it into a copy is:

```
cp filename filename-backup
rm filename
mv filename-backup filename

```

Is there a more direct way (i.e. a single command)?

Answer: 
```
for f in $(find -type l);do cp --remove-destination $(readlink $f) $f;done;

```

* Check symlinks in the current directory and subdirectories `find -type l`
* Get the linked file path `readlink $f`
* Remove symlink and copy the file `cp --remove-destination $(readlink $f) $f`
On OSX 

> 
> rsync `readlink bar.pdf` bar.pdf
> 
> 
>