FTP server is widely used in setup which involves frequent transfer of files. Although multiple GUI based FTP clients are available but still you may need connect FTP server from Linux terminal on Server environment without GUI.
Contents – connect to FTP server from Linux Terminal
FTP commands to perform connection to server, Listing files Download and Upload files in FTP server
Before starting you need a configured working FTP server.
To connect to remote FTP server you will need
- IP address of FTP server and port for Server default is 21
- User name for FTP account
- Password for FTP user
Connect FTP Server from Linux terminal
In terminal type
Syntax
ftp server name or IP address
If domain name is different than default type server name / ip address followed by :portnumber (192.168.0.112:200)
Example
ftp infojinx
ftp 192.168.0.112
ftp 192.168.0.112:200
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 FTP Server from Linux terminal
Once connected check files available. To check you need to use list (ls) command.
Syntax
ls
Changing Directories on FTP Server from Linux terminal
Changing directories on server is simple just use cd command
Syntax
cd <directory name>
cd test
Downloading files from FTP Server using Linux terminal
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 FTP Server from Linux terminal
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 made from Linux terminal
To disconnect working FTP session you can use bye/exit/quit command.
bye
Other articles which will interest you