Celeb Glow
general | March 02, 2026

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_profile

I get:

scp: /home/bleble/.bash_profile: Not a directory

I know it's not a directory.

What am I doing wrong?

1

2 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.

3

For what it's worth, I got this error when mixing up the order of the arguments, i.e. I typed

scp selnpcgwnx1001:~ file1 file2

instead 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy