How to login to a ftp server in linux

From your command line type

ftp > open

Or Alternatively,


It will prompt you for a username and/or password and you can just fill those in.

After you are in, you can see a list of commands by using the command:

ftp> help
Commands may be abbreviated.  Commands are:

!               cr              mdir            proxy           send
$               delete          mget            sendport        site
account         debug           mkdir           put             size
append          dir             mls             pwd             status
ascii           disconnect      mode            quit            struct
bell            form            modtime         quote           system
binary          get             mput            recv            sunique
bye             glob            newer           reget           tenex
case            hash            nmap            rstatus         trace
ccc             help            nlist           rhelp           type
cd              idle            ntrans          rename          user
cdup            image           open            reset           umask
chmod           lcd             passive         restart         verbose
clear           ls              private         rmdir           ?
close           macdef          prompt          runique
cprotect        mdelete         protect         safe

If you are familiar with linux this should be fairly straight forward. The only ones Ill cover for anyone completely new are ls, get and put.

LS .. get a list of files in current directory | CD <directoryname> .. move to new directory
GET .. takes a file from remote server and copies to local server
PUT .. takes a file from your local server and uploads to remote server.

To use get follow the format:

get <filename.ext> <localname.ext>
# The second parameter is optional

Here is a sample list and download operation:

ftp> ls
200 PORT Command successful.
150 Opening ASCII mode data connection for /bin/ls.
drw-rw-rw-   1 user     group           0 Jul 31 13:24 .
drw-rw-rw-   1 user     group           0 Jul 31 13:24 ..
-rw-rw-rw-   1 user     group    3381514808 Nov 17  2012
-rw-rw-rw-   1 user     group    958214842 Nov 16  2012
-rw-rw-rw-   1 user     group    230840946 Oct  2  2012 CPSQLPrerequisites.exe
-rw-rw-rw-   1 user     group       66361 Oct  2  2012
-rw-rw-rw-   1 user     group    403453440 Jul 31 13:21 cpsp84.exe
226 Transfer complete.
ftp> get
local: remote:
200 PORT Command successful.
150 Opening BINARY mode data connection for (3381514808 Bytes).



You may also like...

Leave a Reply