15 practical examples of ftp command

April 17, 2019

Comments

Adsense

Adsense

Adsense

Adsense

FTP stands for File Transfer Protocol.

FTP is one of the most useful command for a system administrator, all administrator almost every day using FTP command to transfer files to FTP server.

Suggested Reading: FTP command structure

Learn FTP command structure and syntax to use FTP frequently for moving backup data or some critical file which needs to move in some safe location.

Here I am going to mention 15 methods to use the FTP command in system admin day-to-day life.

Suggested Reading: FTP command help and Examples

FTP Command Examples:

 Now, let’s discuss on 15 practical uses of ftp command:

Example 1 – Connect FTP server with IP

Connect to ftp server using ftp command as shown below.

$ ftp 192.168.10.1

We can use above command to connect with FTP server “192.168.10.1”.

Example 2 – Connect FTP server with Hostname

Connect to ftp server using hostname of ftp server as shown below.

$ ftp linuxconcept.com

We can use above command to connect with ftp server “linuxconcept.com”.

Example 3 – Upload files into FTP server

To upload files on ftp server, use put command as shown below.

ftp> put linuxconcept.com

The above command will upload the file “linuxconcept.com” on ftp server.

Example 4 – Download files from FTP server

To download files from ftp server, use get command as shown below.

ftp> get linuxconcept.txt

The above command use to download “linuxconcept.txt” file from ftp server.

Example 5 – Upload multiple files into FTP server

To upload multiple files into ftp server use “mput” command as show below.

ftp> mput *.txt

The above command will upload all file into ftp server which has “txt” extension in current local directory.

Example 6 – Download multiple files from FTP server

To download multiple files from ftp server, use “mget” command as show below.

ftp> mget *.txt

The above command use to download all files from current remote directory which has “txt” extension.

Example 7 – Delete file from FTP server

To delete file from ftp server, use “delete” command as show below.

ftp> delete linuxconcept.txt

The above command is use to delete linuxconcept.txt file from ftp server.

Example 8 – Delete multiple files from FTP server

To delete multiple files from ftp server in single command, use “mdelete” as shown below.

ftp> mdelete *.txt

The above command use to delete all files from ftp server which has “txt” extension.

Example 9 – Use help in ftp terminal

To get help in ftp command, use “help” or “?” as show below.

ftp> help
ftp> ?

If you want detailed help on specific ftp command use below syntax of ftp command.

ftp> help <COMMAND>

Example 10 – Changing FTP mode to binary

To change ftp mode to binary, use “binary” command as shown below.

ftp> binary

Example 11 – Changing FTP mode to Ascii

To change ftp mode to asci, use “asci” command as shown below.

ftp> ascii

Example 12 – Changing remote directory in FTP

To change remote server’s directory in ftp server, use “cd” command as shown below.

ftp> pwd
257  “/linuxconcept” is current directory.
ftp> cd testdir
250  CWD  command successful. “/linuxconcept/testdir” is current directory.
ftp> pwd
257  “/linuxconcept/testdir” is current directory.

The above command use to change directory “testdir” on remote server.

Example 13 – Changing local directory in FTP

To change local system directory on ftp prompt, use “lcd” command as shown below.

ftp> lcd /tmp

The above command use to change “/tmp” local directory.

Example 14 – Listing content of the remote directory in FTP

To list all files and content for FTP server’s remote directory, use “ls” or “dir” command as shown below.

ftp> ls
ftp> dir

Example 15 – Close FTP connection

To close the FTP connection from the server, use “quit” or “close” command.

When using the “quit” command, FTP connection will terminate, and you will be on your system back, as shown below.

ftp> quit
$

When you want to close FTP connection from FTP server without coming out from FTP prompt, use “close” command as shown below.

ftp> close
221 Goodbye.
ftp> 
Satish Kumar

Satish Kumar

I am Satish Kumar, Founder of LinuxConcept. Linux and F.O.S.S enthusiast, love to work on open source platform and technologies.

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Adsense

Related Posts

The 30 most useful Linux commands

This article will introduce some practical and common Linux or Unix command , which is the Linux system administrators normally use the command . This article is not a complete list, but a brief list of commands that can be useful...

15 Practical examples of tcpdump command

15 Practical examples of tcpdump command

The tcpdump is the most essential and powerful command-line network packet sniffing tool. We use it to analyze network packets, capture or filter TCP/IP packets that transferred and received over the network on a specific network interface. It is available in almost...

15 Useful “df” Commands to Check Disk Space in Linux

15 Useful “df” Commands to Check Disk Space in Linux

There are several Linux tools available on the internet to check disk space utilization; we can use any of them. But, Linux has a best built-in command-line utility called “df”. The “df” is the short form of “disk filesystem”, we can get detailed information on used...

0 Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

five × one =

News & Updates

Join Our Newsletter

Adsense

Adsense

Adsense

Adsense