
Below, I will introduce how to simply use command line; that is using "ftp" and "sftp" commands in Linux to carry out file transfer operations.
(click here to read more on how to use command lines for FTP and SFTP...)
Backup File with cPanel
This is a simple example of a file created or residing in your web server that you might want to download. For example, a backup file from cPanel.
- Access backup function in cPanel.

- Generate backup of your website.

- This should immediately activate the cPanel to create an archived backup in .tar.gz format and saved it in your home directory, e.g.
/home/[myusername]/
assuming that [myusername] is the username of your account on the server.
Once the backup has completed, it is time to download from the webserver. There are two methods to do so; either FTP or SFTP (using secure connection, provided you are granted permission by the administrator to use SSH).
Logging On Using FTP
- Firstly, open up a terminal console.
- Next, type in the following command (replace "mywebserver.com" with the domain name of your server):
ftp mywebserver.com

- Type in your username and press [Enter].
- Type in your password and press [Enter].
- You should now be connected to the server using FTP protocol.
In case that you are unable to log on, you may want to check your password or your permission to access or use the FTP protocol on that web server.
Logging On Using SFTP (SSH)
In order to use SFTP, please check with your system administrator that you are granted permission to use SSH. If not, you are quite unlikely to use SFTP to transfer your file.
- Again, open up a terminal console.
- Next, type in the following command (replace "mywebserver.com" with the domain name of your server):
sftp username@mywebserver.com

- Type in your password and press [Enter].
- You should now be connected to the server using SFTP protocol.
After gaining access to your system with FTP or SFTP, the next step is to download or upload file between your server and your local machine. Note that, your local machine has to be running Linux in order to use this protocol.
Download File With FTP or SFTP
The methodology below can be used with both file transfer protocol, i.e. FTP or SFTP.
- After gaining access to the web server, check the file on the current directory by typing:
ls -l
If the file does not exist, then access to the directory with "cd" command.
- Download file (e.g. myfile-backup.tar.gz):
get myfile-backup.tar.gz
- Download will automatically commence. Just wait for it to end.
Upload File With FTP or SFTP
The methodology below can be used with both file transfer protocol, i.e. FTP or SFTP.
- After gaining access to the webserver, check the file on the current directory by typing:
ls -l
If the file does not exist, then access to the directory with "cd" command.
- Download file (e.g. myfile-upload.zip):
put myfile-upload.zip
- Upload will automatically commence. Just wait for it to end.
Hence, it is extremely easy to use command line to upload and download files to and from another server, that is running on Linux.




SFTP File Compression
Submitted by Guest (not verified) on Fri, 2008-09-19 08:34.
- reply
How to use -C to compress the file before sending to SFTP.
Compression using SSH
Submitted by keith on Sat, 2008-09-20 05:33.
- reply
If you can use SFTP, I believe you can access the site using SSH. Try Tar.gz Compression Method via Secure Shell connection to compress the file that you want. After which, you can use the method stated in this post here to download or upload the file.
Post new comment