Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to upload multiple files and directories using command line FTP? [duplicate]

Tags:

bash

shell

ftp

Possible Duplicate:
How do you recursively ftp a folder in linux

I'd like to simply upload a directory and all of its contents, recursively, from the command line. To do this from the command line would be so much easier than resorting to FileZilla or some other windowed app.

My workaround for this has been to zip, then upload the zip w/FTP, then SSH and unzip...

Is there a way using the BASH command line ftp to upload multiple files and directories?

Looking at the available commands there is only put and send which allow only a single file and no directory.

like image 581
Tapefreak Avatar asked Jan 01 '26 23:01

Tapefreak


1 Answers

If you have access to SSH, can you also use scp? If so, try something like:

scp -r local_dir you@server:remote_dir

The -r flag allows you to recursively copy to your destination.

like image 133
Michael Avatar answered Jan 04 '26 12:01

Michael



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!