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: 
There is no single command to convert a symlink to a regular file. The most direct way is to use `readlink` to find the file a symlink points to, and then copy that file over the symlink:

```
cp --remove-destination `readlink bar.pdf` bar.pdf

```

Of course, if `bar.pdf` is, in fact, a regular file to begin with, then this will clobber the file. Some sanity checking would therefore be advisable.
in case of "relative" symlinks you could add a awk statement to @jared answer:

```
for f in $(find . -type l); do /bin/cp -rf --remove-destination -f $(find . \! -type l -name $(readlink $f | awk -F"../" '{print $NF}')) $f;done;

```

If you have symlinks pointing to directories you need to use a more radical approach because cp --remove-destination does not work together with symlinks directories correctly

```
for f in `find . -type l`; do (cd `dirname $f`; target=`basename $f`; source=`readlink $target` ; rm -rf $target && cp -r $source $target); done

```

For sure this could be written with less overhead. but it is quite good to read in my opinion.