Scp Command In Linux

Scp Command In Linux – This time we will discuss the transfer or copy of the data on the operating system, SCP Commands for How to Copy Linux Files is very important for you to know. SCP or Secure Copy on Linux is commonly used to do the work of duplicating cross-network files (can be with public ip, vpn, or local ip) work scope based on the CLI (Command Line Interface).

Just to get to you, SCP or secure copy is a safe means to transfer computer files between localhost and remote hosts or between two remote hosts. SCP runs based on the Secure Shell (SSH) protocol.

scp stands for secure cp (copy) is a fairly easy way to copy or transfer files from one computer to another via an SSH connection. With scp we can copy files from a local computer to a Linux server via Terminal. This is very useful when we are not in the GUI and only have a Terminal as the main interface. Following are examples and how to use scp to copy files from one computer to another (Linux OS). The following is information about the Scp Command In Linux tutorial, which you can follow easily:

Scp Command In Linux

The use of the scp command is basically as below:

scp [[user @] host:] source-file [[user @] to host:]


where from-host is an IPaddress computer the source file and to host are the destination computer.

In the following examples I use Debian Linux as a local computer and ClearOS server for the remote server.

1. Copy the file from the local computer to the remote server (IP address

scp /home/namahostingmu/Downloads/wordpress.tar.gz

The above command will copy the wordpress.tar.gz file that is in your / home / namahosting / Downloads to server directory ( in the / var / www directory

2. Copy the directory / folder from the local to the remote server

scp -r / home / namahostingmu / Downloads

The above command will copy the Downloads on / home / namahostingmu folder to / var / www on the remote server ( Attribute -r means recursive so that all files in the Downloads folder will be copied to the remote server.

3. Copy files from remote 1 to remote 2.

scp also allows us to copy files from remote server 1 to a remote server 2. The method is almost the same as copying files from the local computer to the server.

scp root@ /home/namahostingmu/coba.txt root@ / home / server

The above method will copy files from the computer to the computer

Transfer files between servers and SCP

You can use the SCP command to move files from local to destination server or vice versa, for example as follows:

1. Move data from local to destination server (Upload):

scp namahostingmu.txt root@xx.xx.xx.xx: / folder / (for single files)

scp -r namahostingmu / root@xx.xx.xx.xx: / folder / (for folders)

2. Moving data from the destination server to local (Download):

scp root@xx.xx.xx.xx: /folder/namahostingmu.txt your hostname / (for single files)

scp -r root@xx.xx.xx.xx: / your / namahosting folder / (for folders)

Those are just a few tips and also a tutorial on Scp Command In Linux, which you can try yourself easily and quickly. We hope this information can be useful and also help resolve your problem. Good luck with the Scp Command In Linux tutorial above, good luck!