How do I get an entire directory in sftp?

Use the -r (recursive) flag:

get -r *

Use:

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

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.

Tags:

Linux

Sftp