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 text files the `sed` command can do this in one line if you pass it the *in-place* switch (`-i`). This is because `sed` does a single pass over a file, cats the output into a temporary file which it subsequently renames to match the original.

Just do an inline `sed` with no transforms:

```
sed -i ';' /path/to/symbolic/link

```
On OSX 

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