SCP - "not a directory" - What am I doing wrong?
On my remote server I have a file named .bash_profile, that file has nothing inside. I wish to copy a local copy (with something inside) to the remote destination. (overwrite)
So I do:
scp ~/path/bla/ble/.bash_profile :/home/bleble/.bash_profileI get:
scp: /home/bleble/.bash_profile: Not a directory
I know it's not a directory.
What am I doing wrong?
12 Answers
Since you want to copy the file with the same name, you don't need to specify a target name:
scp ~/path/bla/ble/.bash_profile :/home/bleble/Because a .bash_profile exists in the target directory, scp thinks you are giving it a directory as a target, attempts to descend into to it and exits since it is not actually a directory.
For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed
scp selnpcgwnx1001:~ file1 file2instead of the correct
scp file1 file2 selnpcgwnx1001:~For some reason I thought that the fact that you can provide multiple files as arguments meant that those arguments have to be placed last. Wrong, you can have multiple files as arguments and then have the target folder as the last argument.