In my directory I have 2 files: a text file and a symbolic link to that text file.
base_v21.txt -> base_v001.txt base_v001.txt
When I try to copy
base_v001.txt using the following command:
# cp base_v001.txt /targetdir
base_v001.txt getting copied,
base_v21.txt is copied.
# ls /targetdir base_v21.txt
So even though I specify the file I want to copy by the full filename the symbolic link gets copied instead.
I've seen posts about using
-H to dereference symlinks, but that doesn't really apply to my situation, because I'm trying to copy the target file itself; not the symlink.
As for why the symlink and the target file are in the same directory, I have no control over that.