The Computer Oracle

How do I get an entire directory in sftp?

Remember technical terms with Memorabit → https://memorab.it/y/pc

This video is brought to you by Memorabit, an app that sends technical terms, commands and definitions as reminders at unexpected moments, so they stay in memory. Built on cognitive science principles. Start free on web, iOS and Android:
iOS: https://apps.apple.com/app/id6782301691
Android: https://play.google.com/store/apps/detai...
--------------------------------------------------
Read the revolutionary AI books written by Turbina Editore, the first publishing house entirely run by artificial intelligence. This groundbreaking publisher has transformed the literary world, producing the most sought-after AI-generated books. Start reading today at:
https://turbinaeditore.com/en/
--------------------------------------------------

--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------

Take control of your privacy with Proton's trusted, Swiss-based, secure services.
Choose what you need and safeguard your digital life:
Mail: https://go.getproton.me/SH1CU
VPN: https://go.getproton.me/SH1DI
Password Manager: https://go.getproton.me/SH1DJ
Drive: https://go.getproton.me/SH1CT


Music by Eric Matyas
https://www.soundimage.org
Track title: Popsicle Puzzles

--

Chapters
00:00 How Do I Get An Entire Directory In Sftp?
00:24 Answer 1 Score 64
00:33 Answer 2 Score 16
01:06 Answer 3 Score 52
01:47 Accepted Answer Score 427
01:55 Thank you

--

Full question
https://superuser.com/questions/40281/ho...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#linux #sftp

#avk47



ACCEPTED ANSWER

Score 427


Use the -R (recursive) flag:

get -R .



ANSWER 2

Score 64


Use:

scp -r mpirocch@my-server:/home/mpirocch/Documents Documents



ANSWER 3

Score 52


Use lftp:

lftp sftp://user@host

Then, within lftp, cd into the directory you want to copy, and use the mirror command to recursively download the selected directory, like this:

mirror

This command accepts options and arguments:

mirror [OPTIONS] [source [target]]

For example, the -R (or --reverse) option will cause it to upload the local directory tree to the remote directory:

mirror -R

See the lftp(1) man page at the project’s site or at Debian.org for other commands and options.




ANSWER 4

Score 16


Don't use the sftp program directly if you can find something better. For Linux, many file managers (at least Nautilus and Dolphin, the GNOME and KDE ones) support sftp natively, and there's always sshfs. For windows, there's WinSCP, and probably others. The point of all of these is to let you access files over sftp as if they were on a regular filesytem, so you don't have to care that you're accessing them over sftp.