Basic File Transfer Commands In Linux | SCP, SFTP, Rsync


Before trying these commands first check the related packages are installed or not. If not then first installed them.

To check If package is installed or not

rpm -qa | grep "packagename"

Command to install package

yum install "package name"


SCP COMMANDS

1) scp archive.tar(local file) user@ipaddress :

Copy data securly over the network to another user

2)time scp archive.tar(local file) user@ipaddress :

 Show the time taken by system to copy the data

RSYNC COMMANDS

1) time rsync archive.tar(file local) user@ipaddress:

Copy the only changes made in the files , else exited.

2) time rsync archive.tar(file local) -P user@ipaddress:

P option will help to restart the copying file where from copy progress will broke.

See Example Below


SFTP COMMAND : Perform below three steps to send/receive data

1) sftp username@localhost

Connect to the remote user with his userid and password for copy data over sFTP protocol

2) get '/file/path'

To download the file from remote user to your machine , give proper path after get command

3) put '/file/path'

To upload the any file from your machine  to remote user home directory    

Note: by default data files copied to /home folder else you can define the path

Post a Comment

0 Comments