Tech C**P
15 subscribers
161 photos
9 videos
59 files
304 links
مدرس و برنامه نویس پایتون و لینوکس @alirezastack
Download Telegram
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. 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