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: 
Just a rehash of other's answers, but adding the "sanity check" to ensure the link passed in is actually a symbolic link:

```
removelink() {
  [ -L "$1" ] && cp --remove-destination "$(readlink "$1")" "$1"
}

```

This is saying that if the file is a symbolic link, then run the copy command.
There's no single command. But if you don't want a copy and all you want is another reference, you can replace the symlink with a link (aka "hard link"). This only works if they're on the same partition, BTW.

```
rm filename
ln target filename

```