File Transfers in UNIX
Connect to a remote machine thru ssh:
$ ssh username@hostname
Download remote file using rsync:
$ rsync -v -e ssh username@hostname:~/path_to_file.txt /destination_folder
Upload file from a local computer to a remote server:
$ rsync -v -e ssh /path_to_file.txt username@hostname:~/destination_folder
Download remote folder using rsync:
$ rsync -r -v -e ssh username@hostname:~/path_to_folder /destination_folder
Synchronize a local directory with a remote directory:
$ rsync -r -a -v -e “ssh -l username” –delete hostname:/remote_dir/ /local_dir
Synchronize a remote directory with a local directory:
$ rsync -r -a -v -e “ssh -l username” –delete /local_dir hostname:/remote_dir
Advertisement