Copying entire dir using SFTP

9,488

Use -r switch

sftp> get -r folder/
Share:
9,488

Related videos on Youtube

Optimus Prime
Author by

Optimus Prime

Updated on September 18, 2022

Comments

  • Optimus Prime
    Optimus Prime over 1 year

    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?

    • Tobias Gassmann
      Tobias Gassmann over 6 years
      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
    Tobias Gassmann over 6 years
    this actually does copy hidden files! You should emphasize that the key to copying hidden files ist the slash "/" at the end!