FTP From The Linux Terminal

Why would you want to use FTP from the Linux terminal? It’s quick, easy, consistent, and works well enough as an FTP client. If it’s not already installed, it’s just a quick installation command away. In my experience, it’s usually already there.

If I’m going to be transferring a bunch of files or editing files, I’ll just use a GUI FTP client. My choice FTP client has been Filezilla for quite a long time now. It does the trick and I just keep moving my profile/config to new computers as I get them. Being easy to migrate is a definite selling point for me.

So, what is FTP? It stands for File Transfer Protocol. It’s not encrypted, so many folks have moved to SFTP – which is actually not related to FTP at all. It just shares similar functionality. Even though FTP traffic isn’t secure, it’s still fairly widely used. 

An FTP server is probably not installed by default on your desktop Linux system. However, I’ve written how to Install An FTP Server With VSFTPD which should get you sorted if you need one.

The application will be using is “FTP” which describes itself like:

ftp — Internet file transfer program

And you may find that your version of terminal-based FTP is maintained by your distro maintainers. The FTP command and flagsr should still be pretty universal throughout. Still, be sure to check the man page – especially if things seem weird.

FTP From The Linux Terminal:

Obviously, this requires an open terminal.

Press CTRL + ALT + T and your terminal should pop right open.

Once you have the terminal open the command is basically this:

ftp <server>

You can connect via domain name, hostname, or even IP address. It’ll look like this, or pretty close:

See: You can use FTP from the Linux terminal.

There are many commands available, so you should probably check man ftp to see what’s on offer. We’re just going to cover a few of the more useful commands.

You’ll find that ‘ls’ works to list files, just like you’re used to, as does ‘cd’. If you want to change your local directory, that is your working directory on your machine and not the working directory on the server, you need to use the ‘lcd’ command – like so:

lcd ~/Downloads

Note: Read More About Paths

After you’ve logged in and learned to navigate, it’s time to do something. If you want to download something, you use the ‘get’ command:

get <file_name>

That will download the file from the server to the local directory. To do the opposite, that is upload something from your current local directory, you would use the ‘put’ command, like so:

put <file_name>

If you want to get or put more than one file, the commands are ‘mget’ and ‘mput’ respectively. They look like this:

mget <file_name1> <file_name2> <file_name3>
mput <file_name1> <file_name2> <file_name3>

Note: It may give a warning about using passive mode. If that’s the case, add the -p flag to your connection command – like ftp -p hostname.

Just like with your regular terminal file management, you can ‘mkdir’, ‘rmdir’, and even use ‘pwd’ to be reminded of your present working directory. Files can also be deleted with the delete <file_name> command.

Closure:

And there you have it, an article that explains how to use FTP from the Linux terminal. It is important to note that the FTP command transmits data without encryption. If security is a concern, use SCP or SFTP.

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Installing Flatpaks In Linux

Today we're going to have a pretty easy article where you'll learn about installing Flatpaks…

1 day ago

A Quick Look At The Shutdown Command

This is going to be just a quick article about a command many of you…

3 days ago

Setting Up Coding Environments on Linux for Educational Use

With so many strong attributes, such as robustness and flexibility, Linux stands as a powerful…

5 days ago

View Detailed Hardware Information

There are many tools for showing your hardware information and today we'll get to view…

1 week ago

How To: Install Wine In Lubuntu

Today's article isn't going to be complicated or long as we are going to cover…

1 week ago

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

2 weeks ago