Build a Better Process

Linux ftp Command Summary with Examples

Linux ftp allows you to automate the transfer of data.
  1. Purpose - Learn what ftp is for and how to find help.
  2. Options - Review a few common options and arguments.
  3. Examples - Walk through code examples with ftp.
  4. A tip - Finish off with one more insight.
face pic by Paul Alan Davis, CFA
Updated: February 24, 2021
In this tutorial on Linux ftp, 84 of 100, below find a 3-4 minute introductory video, a text-based tutorial and all of the code examples from the video.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / ftp-command.html

An ad-free and cookie-free website.

Examples of the Linux ftp Command


Learn to automate the transfer of files at the Linux command line.

Video Tutorial

Videos can also be accessed from the Linux Essentials Playlist on YouTube.

Linux ftp Command Summary with Examples (3:29)

Video Script

The Command and Why You Need It

Our eighty-fourth word, or command to memorize is ftp from our category Communication.

ftp allows you to automate the transfer of files.

Common Linux ftp Options
-options description
-v Verbose mode showing all server responses

Recall from the last two videos, we covered data transfer from the command line, and a new concept called Protocols and now we'll log in to a remote system using the ftp Protocol.

Before we start, it helps to think of commands as mini programs and most follow this structure: command -option(s) argument(s).

The ftp command has 9 options, and the argument is the hostname, entered like you would an http:// address in your browser, but here use ftp:// and the hostname and optionally a port number.

Unlike most commands, help is not available with double-dash --help. The -v option enters verbose mode showing statistics.

So why is ftp an important command? Well, most people access data sets through their browser manually but using ftp Protocol is a good way to automate transfers. And now you know how to do that.


Okay, the best way to embed this in your memory is by typing in your own terminal window.

Find this on your Mac using a program called Terminal. On Linux use Terminal or Konsole, and currently Microsoft is adding this functionality to Windows.

Here we go. We'll log in to a public US Library of Congress ftp server. The ftp Protocol predates http I mentioned earlier, which you use in your web browser. And some servers let you log in anonymously with no password, and that's what we're doing here.

$ ftp ftp.loc.gov Connected to rs7.loc.gov. 220 rs7 FTP server (Library of Congress) ready. Name (ftp.loc.gov: : anonymous 331 Guest login ok, send your complete e-mail address as password. Password: _ 230 Guest login ok, access restrictions apply. Remote system type is UNIX. Using binary mode to transfer files. ftp> _

And here, if this was a private system you could enter one of about 75 different commands, but many won't work because of security concerns, so I'll just show you a cd to the pub directory, to change directories.

ftp> cd pub 250-Please read the file README 250- it was last modified on Wed Dec 7 10:43:49 1994 - 8006 days ago 250 CWD command successful. ftp>

And last, before we end up on a government watch list, let's type bye to close the ftp connection.

ftp> bye 221 Goodbye.

A Final Tip

Okay now you know how to use ftp. And you know the syntax for commands, options and arguments.

One last tip about the ftp command. So over time the ftp has been replaced by more secure options: lftp or sftp. Here, I simply wanted you to see ftp and I'll introduce other tools shortly.

Okay, thanks for visiting today. I hope this was a helpful introduction to the ftp command.

Learn More About The Series

For an overview of the 100 videos, the 8 quizzes, a cheat sheet, the categories and a Q&A section, visit:

What's Next?

If you support my effort to bring you free content with non-invasive advertising, please consider supporting in some way.

Outline Back Tip Next

/ factorpad.com / tech / linux-essentials / ftp-command.html

linux ftp command
ftp commands
ftp file transfer
linux ftp
ftp linux
ftp transfer
linux ftp server
ftp command line
ftp commands linux
ftp client linux
ftp connection
ftp server
ftp site
secure ftp
ftp command line
linux ftp example
linux ftp client
man ftp
how to use ftp
how to ftp
linux ftp tutorial

A newly-updated free resource. Connect and refer a friend today.