Using FTP command line

This is a brief tutorial on how to use FTP client from command line on Linux.

Connect to FTP server

$ ftp

Insert username and password when prompted.

List files in current directory

ftp> ls

Show current directory

ftp> pwd

Change directory

ftp> cd <directory>

Show help or show help for specified command

ftp> help
ftp> help <command>
ftp> ? <command>

Download a file

ftp> get <file>

Download multiple files

ftp> mget <file*>

Upload a file

ftp> put <file>

Upload multiple files

ftp> mput <file*>

Delete a file

ftp> delete <file>

Delete multiple files

ftp> mdelete <file*>

Create a directory

ftp> mkdir <directory>

Delete a directory

ftp> rmdir <directory>

Enter binary mode for transfering bin files (jpg, doc)

ftp> binary

Enter ascii mode for transfering text files (txt, dat, html)

ftp> ascii

Terminate FTP session and exit

ftp> bye
ftp> quit