How to connect to ftp server from Linux Terminal

FTP commands for dummies

Before starting you need a configured working FTP server.

To connect to remote FTP server you will need

  1. IP address of FTP server and port for Server default is 21
  2. User name for FTP account
  3. Password for FTP user

Connect to FTP from terminal

In terminal type

ftp server name or IP address

If domain name is different than default type server name / ip address followed by :portnumber (

Once you are connected to ftp server, it will ask for username and password, enter them as asked.

Transfer files from / to FTP server

Listing files on Server

Once connected check files available. To check you need to use list (ls) command.


Changing Directories

Changing directories on server is simple just use cd command

cd test

Downloading files

Downloading files from remote ftp server requires to things – first you need to set up local download path and downloading files

to set local path use command lcd

lcd /home/user/local_directory_name

If you have started ftp session from local directory into which you want to copy file, you can skip this step.

Finally to download file type

get file_name

Uploading files

To upload files to remote ftp server you need to use command

put file_name

similiar to downloading files you can change local directroy by using lcd command.

Disconnecting FTP connection

To disconnect working FTP session you can use bye/exit/quit command.


Other articles which will interest you

How to configure FTP Server in Linux