This example will send the Boomsrc folder and all of the contents to the remote machine under the /home/jason/Desktop directory. This is very fast and secure.
┌──[jason@192.168.1.2]─[~/Documents] └──╼ ╼ $ tar cBf - Boomsrc | compress -c | ssh jason@192.168.1.3 "cd /home/jason/Desktop; uncompress -c | tar xBvf -" |
This is very useful for backing up files from a laptop to a server.
Then you may use this command to list the remote files.
┌──[jason@192.168.1.2]─[~/Documents] └──╼ ╼ $ rsync --list-only jason@192.168.1.3:/home/jason/Desktop/ jason@192.168.1.3's password: drwxr-xr-x 4,096 2021/03/04 09:34:30 . drwxrwxr-x 4,096 2020/11/10 09:49:12 Boomsrc |
This is a very useful tip for transferring files to and fro across a network using Linux.
This is another example, this will copy the contents of the Desktop folder on one machine to another over a secure SSH connection.
┌──[jason@192.168.1.2]─[~/Documents] └──╼ ╼ $ rsync -avz -e "ssh -p 22" jason@192.168.1.3:/home/jason/Desktop/ /home/jason/Desktop jason@192.168.1.3's password: receiving incremental file list ./ Boomsrc/ Boomsrc/about.txt Boomsrc/allegro.h Boomsrc/am_map.c Boomsrc/am_map.h Boomsrc/bin2c.c Boomsrc/bmp2c.c Boomsrc/book.old Boomsrc/boom.txt Boomsrc/boomdeh.txt Boomsrc/boomref.txt Boomsrc/changes.old Boomsrc/common.cfg Boomsrc/copying Boomsrc/d_deh.c Boomsrc/d_deh.h Boomsrc/d_englsh.h Boomsrc/d_event.h Boomsrc/d_french.h Boomsrc/d_items.c Boomsrc/d_items.h Boomsrc/d_main.c |
This is a very useful way to connect and transfer files.
Another useful way is to use Midnight Commander on Linux and press F9. Then choose the SFTP link option and connect to a remote machine. Then copying files over a network is very easy to do.
Use these tips and transferring files is as simple as it can be.