1

In sftp, put * or get * do not get the hidden files or directories inside a dir.

What to do if I want to use sftp to copy entire dir, along with the subdirs that are hidden?

For example, a .git directory inside the directory. I do not require the scp commands. How to do that in a sftp shell?

Optimus Prime
  • 125
  • 1
  • 1
  • 7
  • this is *not* a duplicate. This question is concerned with hidden files. The linked question does not say anything about hidden files. Additionally this is the number one google-hit for "sftp hidden files" – Tobias Gassmann Sep 09 '17 at 21:39

1 Answers1

5

Use -r switch

sftp> get -r folder/
Kride
  • 1,139
  • 8
  • 12
  • 3
    this actually does copy hidden files! You should emphasize that the key to copying hidden files ist the slash "/" at the end! – Tobias Gassmann Sep 09 '17 at 21:47