Chapter 7 File transfer

7.1 Transferring files between local computer and Linux server

To transfer files between local computer and Linux sever, there are two options: 1) GUI application and 2) command line.

  • Open FileZilla and then click File -> Site Manager.

GUI means there will be window, buttons, menus, etc. The most popular system with GUI is Windows system (Figure @ref(fig:filezilla_screenshot1)).

(ref:filezilla_screenshot1) FileZilla application.

(ref:filezilla_screenshot1)

(#fig:filezilla_screenshot1)(ref:filezilla_screenshot1)

7.1.1 Use command line tools

rsync compares the files at each end and transfers only the changed parts of changed files. When you transfer files the first timeo it behaves pretty much like scp, but for a second transfer, where most files are unchanged, it will push a lot less data than scp. It’s also a convenient way to restart failed transfers - you just reissue the same command and it will pick up where it left off the time before, whereas scp will start again from scratch.

7.1.1.1 Copy files using rsync

7.1.1.2 Copying Files with scp

The command scp is short for secure copy. It can be used to copy files between hosts on a network. It uses ssh(1) for data transfer, and uses the same authentication and provides the same security as ssh(1).Scp will ask for passwords or passphrases if they are needed for authentication.

File names may contain a user and host specification to indicate that the file is to be copied to/from that host. Local file names can be made explicit using absolute or relative pathnames to avoid scp treating file names containing ‘:’ as host specifiers. Copies between two remote hosts are also permitted.

# Copy the file test.pl on 198.211.107.37 to the current directory.
scp guest4bioinfor@198.211.107.37:~/test.pl ./

To copy files from a server to a client, you need to know where the files are located on the server. For example, to copy a single file ~/test.pl from the server with IP address of 198.211.107.37 to the current directory.

# Copy the file test.pl in the current directory to  198.211.107.37
scp ./test.pl guest4bioinfor@198.211.107.37:~/

To copy files from a client to a server, you need to know where the files you want to put on the server. For example, to copy a single file test.pl from the current folder to the HOME folder of the server with IP address of 198.211.107.37.

If you want to copy an entire directory recursively, you can use -r argument. See the example below:

# Copy the file test.pl in the current directory to  198.211.107.37
scp -r guest4bioinfor@198.211.107.37:~/bioinfo/ ./

7.1.2 Download files

wget <url>

Resume

wget -c <url>  

Reference:

RH066x Fundamentals of Red Hat Enterprise Linux on edX