Few Useful Commands for Connect to FTP

2015/01/032 min read
bookmark this
Responsive image

Table of Contents

Introduction

Here are a few useful tips about connecting to an FTP server by command line.

Connecting to the FTP Server

ftp [The server name or IP Address]

user : [Enter the user name]

Password: [Enter the password]

After logging in, you can type help to see all the commands, or reference the links below to see the details.

ftp command list

Common FTP Commands

I'll list a few common commands.

ls - lists all the files.

ftp> ls

dir - lists files if connected.

ftp> dir

get [Host name or IP address] - connects to the FTP server again.

mget * or mget *.dll - gets multiple files by the rule.

ftp> mget *

mput * or mput *.dll - uploads multiple files by rule. * means all the files or folders at your current command line directory. *.dll means all the files with the .dll extension.

ftp> mput *

close - closes the current connection.

ftp> close

Example: Uploading Files to FTP Server

Assume the FTP server is set up correctly and you are able to connect with a specific user.

You want to upload all the files and folders from your E:/test folder to the FTP server's DESC folder.

Open the command line and navigate to E:/TEST:

E:/test

Connect to the FTP server:

ftp -i [Server name]

Connect with your user and enter the password.

After connecting successfully, navigate to the DESC folder:

cd DESC

When the command line shows 250 CWD Command successful, you can upload your files to the FTP server folder by typing the following command, which uploads everything from the local command line folder:

mput *

Conclusion

These basic FTP commands allow you to connect to a server, list files, download, and upload files efficiently from the command line. For more advanced operations, refer to the full FTP command reference documentation.