Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upload Folder via Mac Terminal

Tags:

macos

How can I upload an entire folder via FTP Mac Terminal?

like image 988
Zach Smith Avatar asked Aug 13 '09 17:08

Zach Smith


People also ask

How do you upload a file in Mac terminal?

In the Terminal app on your Mac, use the mv command to move files or folders from one location to another on the same computer. The mv command moves the file or folder from its old location and puts it in the new location.

How do I copy and paste a folder in Mac terminal?

In the Terminal app on your Mac, use the cp command to make a copy of a file. The -R flag causes cp to copy the folder and its contents. Note that the folder name does not end with a slash, which would change how cp copies the folder.


1 Answers

Do you have to use ftp? I like to use scp (secure copy) when the remote host supports ssh (as so many of them do).

scp -r mydirectory [email protected]:destdir

The -r means "recursive" so it will recursively copy the entire directory. Replace username with your username, etc., etc. destdir is a relative path on the remote server (whatever directory you wind up in if you log in) as long as you don't use a leading slash / -- then it will be an absolute path.

like image 109
dustmachine Avatar answered Sep 29 '22 17:09

dustmachine