Copy

Copy recursively

cp -r <filename> <destination_directorypath> 

scp - allows you to copy files from one server to another using SSH

Copy files from/to remote server

scp <username>@<hostname or IP Address>:<filename> <destination_directorypath>
scp <filename> <username>@<hostname or IP Address>:<destination_directorypath>

Copy directories from/to remote server. (p flag for preserving permissions)

scp -pr <username>@<hostname or IP Address>:<directorypath> <destination_directorypath>
scp -pr <directorypath> <username>@<hostname or IP Address>:<destination_directorypath>

Last updated

Was this helpful?