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: 
On OSX 

> 
> rsync `readlink bar.pdf` bar.pdf
> 
> 
>
This solution works with symlink files and symlink folders/subfolders.

One line, no script needed.
This would be ideal to export or transfer symlinks elsewhere.

Put everything inside a folder.

rsync --archive --copy-links --recursive folderContainingSymlinkFilesAndSymlinkFoldersAndSubfolders myNewFolder