I need to copy a hiddden dot directory from remote to local. I tried this:

scp ssh:/home/ubuntu/.gnupg/ /local/target

But this gives me an error scp: /home/ubuntu/.gnupg: not a regular file

  • 1
    man scp | less -p '-r'...
    – jasonwryan
    Oct 20 '17 at 4:46

Since it's a directory, you need -r switch for scp. So the command would be something like:

scp -r ssh:/home/ubuntu/.gnupg/ /local/target

Not the answer you're looking for? Browse other questions tagged or ask your own question.