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:
ftp
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:
ftp 192.168.128.2
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
ls
Here is a screenshot:
There are many more commands, for example:
- mkdir : Create folders
- chmod : Change permissions
- of the : 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:
man ftp
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.
regards
Good contribution!!!!
If you want to make an automated connection with ยปftpยป and it is not necessary to put user & pass, you have to create the file in the user's $ HOME
.netrc with chmod 600 permissions, containing:
machine [name-defined-in- / etc / hosts] login [username] passwd [passwdor]
....
Good article friend: D ..
By the way, the previous topic of desdelinux for my project since I created a new theme of my own and in the end I chose Drupal as the CMS instead of WordPress.
I already knew you were going to opt for Drupal (for theme design, Drupal is like Blogger on steroids).
With regard to updates, it is easier to use the drush than to manage everything at the end of FTP.
Well Drupal is more than just Blogger on steroids: D ... It serves very complex content very well and is very scalable. The learning curve is much bigger than that of Joomla and abysmal compared to WordPress, but Drupal does not limit you in anything and its speed deserves an effort :).
Excellent. I was already saying why these commands appear when using FileZilla.
I know that the intention of the post is to show how to connect with a single command, but I really recommend midnight commander (mc), it allows you to connect to an FTP / SFTP and send (upload) files in such a simple way.
Well, there my contribution to the community. Cheers
Good afternoon,
I'm doing a practice that requires me to connect to an FTP server from a kali linux VM and it tells me command not found when I put ftp or man ftp on it.
I'm missing something, right?
I just installed, and well I connect to my local server, and when I try to send a file I get an error
"553 Could not create file."
this message I get. What could be failing?