How To Use Ftp Server From Command Line Tutorial with Examples

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-use-ftp-server-from-command-line-tutorial-with-examples/
PINTEREST
PINTEREST
INSTAGRAM

Ftp is very popular file transfer protocol over computer networks and internet. Ftp provides simple but efficient commands and features to download and upload files over network. In this tutorial we will look most used FTP commands.

If you need to install FTP server look following tutorial.

http://www.poftut.com/how-to-install-and-configure-vsftpd-ftp-server-in-linux-ubuntu-debian-centos-fedora-rhel/

Install Ftp Client For CentOS, Fedora, RHEL

Ftp command is not installed by default most of the distributions. We can install ftp command with the following command.

Install Ftp Client For CentOS, Fedora, RHEL
Install Ftp Client For CentOS, Fedora, RHEL

Install Ftp Client For Ubuntu, Debian

We can install ftp command for the Ubuntu and Debian like below.

Connection FTP Server

First step to connect an ftp server is providing the ip address or domain name of the server to the ftp command. In this example we will connect IP address . The user name and password will be asked. We can use anonymous account which user name and password is anonymous

Connection FTP Server
Connection FTP Server

If the authentication is successful we will get 230 Login Successful response from ftp server.

Show Connection Status

After connecting an ftp server we may need to check the connection status and detailed information about the connection. We can use status command.

List Files

Remote ftp servers will provide a lot of files and folders. We can list these files and folders with ls or dir command like below.

or

List Files 
List Files 

List Current Working Directory

We can list current working directory on the remote ftp server with pwd command.

LEARN MORE  Best SFTP or SCP Clients For Windows Operating Systems

Change Remote Current Working Directory

We generally need to change current working directory. We will use cd command in order to change current working directory on ftp server. In this example we will change to the directory named backups

Change Current Directory
Change Current Directory

Change Local Current Working Directory

We also have a local current working directory too. This will be used to store downloaded files and looking for upload files. We will use lcd . In this example we change local current working directory to the /home/ismail/

Download or Get File From FTP Server

Now we can start the show. The most popular command for ftp is get . get is used to download files from remote ftp server to the local system. File will be download tot the current local working directory. In this example we will download the backup.tar.gz

Download or Get File From FTP Server
Download or Get File From FTP Server

Download or Get Multiple Files From FTP Server

Wget use mget command in order to download multiple files from ftp server.

Also we can use glob *.* to download all files in the current working directory.

Put Or Send File To The Ftp Server

We will use put command in order to send or upload local files. In this example we will upload file named backup.tar.gz . The file must be located in the current local working directory if not change local current working directory accordingly.

LEARN MORE  How To Install WinSCP Into Windows Operating Systems

Create Directory On Ftp Server

We can create a directory on the remote ftp server without uploading anything. We will use mkdir command for this.  In this example we will create a directory named public .

Delete File In The Ftp Server

We can use delete command in order to remove or delete files on the remote ftp server. In this example we will delete the file named backup.tar.gz .

Delete Folder or Directory From Ftp Server

We can remove empty directories from ftp server with the rmdir command. In this example we will remote directory named iso

Delete Folder or Directory From Ftp Server
Delete Folder or Directory From Ftp Server

Disconnect or Exit From Ftp  Server

We can exit from ftp server interactive shell with the command exit

RSS
EMAIL
FACEBOOK
FACEBOOK
GOOGLE
GOOGLE
https://www.poftut.com/how-to-use-ftp-server-from-command-line-tutorial-with-examples/
PINTEREST
PINTEREST
INSTAGRAM

Leave a Reply

Your email address will not be published.