How to copy files from one machine to another in Linux?

This can be done using SFTP command as follows

sftp <user_name>@<hostName or IPAddress>:<file_path_source_Machine> <file_path_destination>
     
Sample command,

sftp user1@16.1.1.5:/home/user1/book.txt /home/user2/test/book.txt    

After executing the above command, System will prompt for the password of the source machine. On successful authentication, it will copy the files to destination directory.

Search