Ubuntu Linux ftp command line

This is a guide on how to connect to Ubuntu ftp using command line.



  1. Type ftp and enter to continue.

  2. Type open and enter to continue.

  3. Type ftp server ip address and enter to connect to ftp server.

  4. If connected, type login name and enter.

  5. Type user password and enter. If the username and password are valid, then you'll be in.


Here is the actual example from Ubuntu command line terminal:



luzar@ubuntu:~$ ftp
ftp> open
(to) 192.168.1.3
Connected to 192.168.1.3.220
---------- Welcome to Pure-FTPd [privsep] [TLS] ----------
220-You are user number 1 of 50 allowed.
220-Local time is now 10:42.
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 (192.168.1.3:luzar):
331 User luzar OK.
Password required
Password:
230-User luzar has group access to:
luzar admin lpadmin fuse
230- plugdev video dip audio floppy cdrom dialout adm
230 OK. Current directory is /home/luzar
Remote system type is UNIX.Using binary mode to transfer files.
ftp>


Now that you are already in the ftp server, let's check the Ubuntu ftp command that you can use. Type help:



ftp> help
Commands may be abbreviated. Commands are:
! debug mdir qc send$
dir mget sendport siteaccount disconnect
mkdir put sizeappend exit mls
pwd statusascii form mode quit
structbell get modtime quote systembinary
glob mput recv suniquebye hash
newer reget tenexcase help nmap
rstatus tickcd idle nlist rhelp
tracecdup image ntrans rename typechmod
lcd open reset userclose ls
prompt restart umaskcr macdef passive
rmdir verbosedelete mdelete proxy runique ?
ftp>


That's all the ftp commands that you can use.The most important command in ftp is help. The ftp help command is similar to whatis command in Linux. The ftp help command syntax is . Here is an example of ftp help command:




ftp> help get
get receive file


You can also use ? to check ftp command meaning. It is the ftp help command short form. Here is an example of ftp ? command:




ftp> ? put
put send one file
ftp>

You can use ls command to list a directory content in ftp server:



ftp> ls
200 PORT command successful
150 Connecting to port 39545
-rwxrwxrwx 1 luzar luzar 16 Nov 4 06:36 File.txt
drwx------ 3 luzar luzar 4096 Oct 21 11:14 folder
-rw-r--r-- 1 luzar luzar 89 Nov 4 09:48 mysql-init
-rw-r--r-- 1 luzar luzar 16 Nov 4 08:52 new-file.txt
226-Options: -l226 4 matches total
ftp>

The ftp command used to download a single file from a server is get.



The ftp command used to download a multiple files from a server is mget.



The ftp command used to upload a single file to a server is put.



The ftp command used to upload a multiple files to a server is mput.



If you want to exit frm ftp, use ftp bye command.



That's the basic ftp commands you need to know to use ftp in the Ubuntu command line terminal. You can check the rest of ftp commands with help like the example above.



That's all.