To upload, download or manage the content of an FTP we have endless graphic applications, Filezilla is one of the most popular. But how to do this from the command line?
Especially when we work on a server and we do not have a GUI, we need to upload a file to an FTP or simply delete something, create a folder, etc, do anything and we only have our terminal, nothing else.
To work with an FTP server, a single command is enough:
We put the ftp command and followed by it the IP address (or host) of the FTP server we want to connect to and that's it, for example:
As shown in the image below, the user will ask us, we write it and press Enter, then it will ask us for the password, we write it and press Enter, ready we go!
Now is where we write the commands in this new shell which is the ftp shell, for example to list we use the command ls
Here is a screenshot:
There are many more commands, for example:
- mkdir : Create folders
- chmod : Change permissions
- of : Delete files
They look like the Linux ones right? ... hehe, if they write help in the FTP shell they get commands that they can use:
The question (and some wonder) I imagine is ... how to upload a file right?
To upload a file the command is send
The syntax is:
send archivo-local archivo-final
For example, suppose I have in my Home a file called video.mp4 and we want to upload it to a folder called videos, the command would be:
send video.mp4 videos/video.mp4
As simple as that, the log / output that it returns is similar to this:
local: video.mp4 remote: videos / videdo.mp4 200 PORT command successful. 150 Opening BINARY mode data connection for test. 226 Transfer complete. 0 bytes transferred. 0.00 KB / sec.
As I always tell you, if you want to know many more options, just read the command manual:
Or read the manual at someplace from Internet.
Well that, I do not pretend that this is a super manual, much less ... it is to lay the foundations only
Still, I hope it has been useful to some.