Linux ftp tutorial - ftp client guides

What is FTP?

FTP stands for file transfer protocol. It is widely used as file transfer protocol in the Internet and file sharing in local networks such as in university, business and organizations around the world. Basically, ftp allows data sharing in a networking environment. It is a client-server concept, where an ftp server serves all clients in the network.

Although we can send and receive file using email attachment, but the fact that email only allows small size attachment has made ftp a popular protocol to transfer files. In Linux environment, ftp is very important because many task and application use ftp protocol such as Linux package management system. Another example of ftp important usage is transfering large web site files to the web server.

A standard ftp port is port 21. You can check ftp port using telnet command to make sure it's open or not. The command syntax is telnet domain-name 21. You can also use ip address and replace domain-name. Here is the example on how to check ftp port 21 using telnet command:

[email protected]:~$ telnet slackware.example.com 21
Trying 192.168.0.3...
Connected to slackware.example.com.
Escape character is '^]'.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 2 of 50 allowed.
220-Local time is now 21:35. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
quit
221-Goodbye. You uploaded 0 and downloaded 0 kbytes.
221 Logout.

The example shows the server port 21 is open and not blocked by firewall. When using telnet command to check ftp port, we use 'quit' commmand to exit from telnet. To download files and upload files to the ftp server, we are going to use a proper ftp client.

Linux ftp client

If you are using Slackware Linux, you can use gftp, which is a gui ftp client program comes by default installation in KDE. If you are using Ubuntu desktop, you can also install gftp in gnome. Here is gftp program information:

gFTP is a multithreaded FTP client. This version of it runs under X and was written using GLib/GTK+.
gFTP features:
* simultaneous downloads,
* resuming of interrupted file transfers,
* file transfer queues,
* downloading of entire directories,
* FTP and HTTP proxy support,
* remote directory caching,
* passive and non-passive file transfers,
* drag-n-drop support,
* bookmarks menu,
* support for SSH and SSH2 file transfers,
* support FXP transfers,
* stop button, and many more features.
Author: Brian Masney

Homepage: http://www.gftp.org/

There are other free ftp client programs that you can install in Linux such as:

Java GUI client for FTP, SMB, SFTP and NFS

JFtp is a graphical Java network and file transfer client. It supports FTP using its own FTP API and various other protocols like SMB, SFTP, NFS, HTTP, and file I/O using third party APIs. It includes many advanced features such as recursive directory up/download, browsing FTP servers while transferring files, FTP resuming and queueing, browsing the LAN for Windows shares, and more. Multiple connections can open at a time in a Mozilla-style tabbed browsing environment.

Homepage: http://j-ftp.sourceforge.net

KFTPGrabber ftp client for KDE

KFTPgrabber is a graphical FTP client for the K Desktop Environment. It implements many features required for usable FTP interaction.
Feature list:
* Multiple simultaneous FTP sessions in separate tabs
* A tree-oriented transfer queue
* TLS/SSL support for the control connection and the data channel
* X509 certificate support for authentication
* FXP site-to-site transfer support
* One-time password (OTP) support using S/KEY, MD5, RMD160 or SHA1
* Site bookmarks with many options configurable per-site
* Distributed FTP daemon support (implementing the PRET command)
* Can use Zeroconf for local site discovery
* Bookmark import plugins from other FTP clients
* Support for the SFTP protocol
* A nice traffic graph
* Ability to limit upload and download speed
* Priority and skip lists
* Integrated SFV checksum verifier
* Direct viewing/editing of remote files
* Advanced default "on file exists" action configuration
* Filter displayed files/directories as you type

Homepage: http://www.kftp.org

FileZilla ftp client

FileZilla is a fast and reliable FTP client for Windows with lots of useful features and an intuitive interface.
It's now multi-platform.
This package contains localization for FileZilla. More than 40 languages are available.

Homepage: http://filezilla-project.org/

FTP client how to

This is a basic ftp client guide tutorial. You will learn how to use ftp client from command line terminal and using graphical user interface ftp client program. In command line terminal ftp client guide, you will learn ftp command to connect to the ftp server, download and upload files to the ftp server. It doesn't matter if you use Linux or Windows operating system, ftp is a standard network protocol. The basic ftp commands should be the same.

How to use ftp commands

Most Linux distributions come with ftp client by default. If your Linux doesn't have one, you can always use ftp client from the command line terminal. Just type 'ftp' without any option and enter. You can also use ftp client from Windows command prompt. The procedure is the same as using ftp from Linux command line terminal.

Example running ftp client from windows operating system (Click Start --> Run --> cmd):

Microsoft Windows XP [Version 5.1.2600]
C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\bill> ftp
ftp>

Let's see what commands do we have in ftp program. Type 'help' at the ftp prompt and press 'Enter':

ftp> help
Commands may be abbreviated. Commands are:
! delete literal prompt send
? debug ls put status
append dir mdelete pwd trace
ascii disconnect mdir quit type
bell get mget quote user
binary glob mkdir recv verbose
bye hash mls remotehelp
cd help mput rename
close lcd open rmdir

We want to establish a connection with the ftp server. The correct ftp command to use is the open command. Type open and press Enter. You need to provide the ftp server's ip address:

ftp> open
To 192.168.0.5
Connected to 192.168.0.5.
220 Microsoft FTP Service
User (192.168.0.5:(none)): ftpuser
331 Password required for ftpuser.
Password:
230 User ftpuser logged in.
ftp>

Here are examples using ftp client from Linux command line terminal. To run the ftp client, type 'ftp' at the command prompt and press 'Enter':

[email protected]:~$ ftp

To open connection with ftp server, use ftp command 'open' and provide ftp server domain name or ip address:

ftp> open
(to) ftp.example.com
Connected to ftp.example.com.
220---------- Welcome to Pure-FTPd [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 18:18. Server port: 21.
220-This is a private system - No anonymous login
220-IPv6 connections are also welcome on this server.
220 You will be disconnected after 15 minutes of inactivity.
Name (ftp.example.com:bill): bill[@]example.com
331 User bill[@]example.com OK. Password required
Password:
230-User bill[@]example.com has group access to: bill
230-OK. Current restricted directory is /
230 0 Kbytes used (0%) - authorized: 2048000 Kb
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

As we can see from the example above, we use ftp server domain name instead of ftp server's ip address. This is useful since it's easier to remember domain name rather than ip address.

Here is another tips. We can also provide ftp server ip address when invoking ftp command. This will skip the ftp 'open' command. See the example below on how to do this:

[email protected]:~$ ftp 172.16.153.129
Connected to 172.16.153.129.
220 ProFTPD 1.3.1 Server (Ubuntu FTP server) [172.16.153.129]
Name (172.16.153.129:luzar): labu
331 Password required for labu
Password:
230-Welcome, archive user [email protected] !
230-
230-The local time is: Sat Feb 21 18:26:53 2009
230-
230-This is an additional FTP server. You only have permission
230-to download files. If you have any unusual problems,
230-please report them via e-mail to [email protected]
230-
230 User labu logged in
Remote system type is UNIX.
Using binary mode to transfer files.
ftp>

Ftp upload how to

Now we are connected to the ftp server. It doesn't matter if we use Linux or windows because once the connection established, all the commands are the same. We use ftp supported commands and you can view them all by issuing help at the ftp prompt. For example, try help mput:

ftp> help mput
mput send multiple files

The ftp mput command can be used to send multiple files to the ftp server. That means if we have permission to upload files to ftp server, we can send multiple files using ftp mput command. Let's see an example on how ftp upload works:

ftp> lcd
Local directory now /home/bill
ftp> mput perlintro.txt
mput perlintro.txt? y
200 PORT command successful
150 Connecting to port 50861
226-24 Kbytes used (0%) - authorized: 2048000 Kb
226-File successfully transferred
226 0.406 seconds (measured here), 59.28 Kbytes per second
24653 bytes sent in 0.134 secs (1.8e+02 Kbytes/sec)

What I did (command in red) above are lcd command to check my 'local directory' (client computer), then I used mput command to upload perlintro.txt file to the ftp server. To confirm the ftp upload, enter y.

The ftp command mput also can be used to transfer a single file. However, the correct ftp command to send a single file is the put command.

ftp> help put
put send one file
ftp>

Ftp download how to

Here is a guide on how to download files from ftp server. Use ftp command mget to download files from ftp server.

ftp> help mget
mget get multiple files

Here is an example on how to use ftp mget command to download files from ftp server:

ftp> mget perlintro.txt
mget perlintro.txt? y
200 PORT command successful
150-Connecting to port 29807
150 24.1 kbytes to download
226-File successfully transferred
226 0.000 seconds (measured here), 510.94 Mbytes per second
24653 bytes received in 1.07 secs (22 Kbytes/sec)

The ftp command mget normally used to download multiple files from ftp server, but in our example, it is used to download a single file. The right ftp command to download a single file is the get command. You probably noticed, why did I mention this? Because some ftp server did not accept get command, so you can use mget if you happened to encounter one.

To exit from ftp server, type bye and press enter.

Graphical user interface (GUI) ftp client

If you are a Linux desktop user and prefer using graphical user interface ftp client program from kde or gnome, here are step by step screenshot examples on how to use gftp ftp client to download and upload files:

Click Remote and choose Open location

Open location gui ftp client screenshot image

Enter domain name or ip address of the ftp server:

Enter ftp server address gui ftp client screenshot image

Enter username or user account to connect to the ftp server:

Enter user name gui ftp client screenshot image

Enter password for user account to connect to the ftp server:

Enter password for ftp server gui ftp client screenshot image

If your username valid and your password is correct, you should be successfully login into the ftp server. In gftp, click on the file or directory in the local directory and click upload arrow icon to transfer file to the ftp server. If you want to download file or directory, click on the file or directory in the ftp server, and click download arrow. See screenshot image below for example:

Download file from ftp server gui ftp client screenshot image

All gui ftp client program works almost the same. If you are using other gui ftp client, and there is no download/upload arrow icon, maybe you can right-click on the file or folder you are going to transfer and see if there are download/upload options available. If not, the transfer menu should be available in your ftp client so that you can upload and download files to the server.

That's all you need to know about Linux ftp client. If you are looking for ftp server setup tutorial, you can find it in Linux network - Install and configure vsftpd in Slackware Linux for Slackware ftp server and Linux network - Install and configure proftpd in Ubuntu Server for Ubuntu ftp server. Good luck!

Back to Linux network command tutorial page.

Tags: 

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.