Most linux system administrators prefer to use commandline for most of the time and i have always struggled to use ftp commands to upload and download backup tar gz files. That is why i decided to post it here. I know how important it is to know these commands in crucial disaster situations and you may feel handy with these.
It is very simple and just follow below on how to upload and download files from FTP server to your local host.
1. Just enter ftp and your hostname or IP in the linux command line. You will be asked to enter user name and password.
> ftp xx.xx.xx
Connected to xxxxxxx.
220 FTP server ready.Name (xxxx:root): xxxx
331 Password required for xxx.
Password:
230 User xxx logged in, access restrictions apply.
Then
List files: ftp > ls
(2) Remember you should change to BINARY mode if you want to transfer files other than text files. Command to change to BINARY mode.
ftp> binary
(3) To upload a file use put and to upload multiple files use mput. Dont forget to change the destination directory.
ftp > cd testdir
ftp > put backup.tar.gz
ftp> mput backup*
(4) To download a file from your FTP server locally, just use get and mget command.
ftp > cd testdir
ftp > get backup.tar.gz
ftp> mget backup*
To close ftp shell, just type bye and it will close.
If you are having problems, transferring a file make sure that you have not blocked the FTP port 21 with the firewall.
Similar Posts:
- How to do backups with Network Attached Storage (NAS) in Linux
- [Fix] Fatal error: Unable to read 25447 bytes in index.php
- How to Upload Files using SSH
- How to install a local copy and configure WordPress on Ubuntu
- EASY way to install Zend Optimizer in Cpanel
- Uploading Files using Unzip in Linux
- Easy methods to Backup your Cpanel files
- Install FTP Server for Centos/RHEL
- Cool Macbook keyboard shortcuts to First time users
- Transfer backup files from server to server in command line!

