Use readlink And use cp --remove-destination To remove symlinks