It has been set to my routine task to copy folder/files from my local host or a remote linux server to another server or vise versa.
The general command is:
The above command will copy a file from your local machine to a remote server. If you want to copy a folder to a remote machine user
You can also copy from your remote server to your local machine by changing the order in scp as below:
The above command will copy the remote file called
#linux #sysadmin #scp #copy
scp
linux command is used for this specific need.The general command is:
scp YOUR_LOCAL_FILE USERNAME@YOUR_SERVER:~
The above command will copy a file from your local machine to a remote server. If you want to copy a folder to a remote machine user
-r
to recursively copy the whole folder into the remote.You can also copy from your remote server to your local machine by changing the order in scp as below:
scp USERNAME@YOUR_SERVER:~/YOUR_REMOTE_FILE .
The above command will copy the remote file called
YOUR_REMOTE_FILE
from the home
directory to your current path (.). Instead of dot you can provide your full path.NOTE:
use man scp
and see tons of flags to master this command.#linux #sysadmin #scp #copy