FTP download file get and upload file put command under Linux command line

The command used to view the files in the corresponding directory of user peo on the remote ftp server is: ls. After logging in to ftp, the command to view the files in the corresponding directory of the local machine user anok at the ftp command prompt is: !ls. To query the ftp command, enter: ? at the prompt, then press Enter.

 

1. The command format for downloading files from a remote ftp server:

get The name of the file to be downloaded in the current directory on the remote ftp server [the file name when downloading to the current directory on the local machine], such as:

get  nmap_file  [nmap]

It means to download the file nmap_file under the remote ftp server to the current directory of the local machine, and change the name to nmap.

The brackets indicate that it can be written or not. If it is not written, it will be downloaded with the file name.

 

If you want to upload files to the ftp server, you need to modify the vsftpd configuration file, the name is vsftpd.conf, in the /etc directory. Remove the "#" in front of "#write_enable=YES" and save it, then restart the vsftpd service:

sudo service vsftpd restart。

 

2. The command format for uploading files to the remote ftp server:

put The name of the file to be uploaded in the current directory on the local machine [the file name when uploading to the current directory on the remote ftp server], such as:

put  sample.c  [ftp_sample.c]

It means to upload the file smaple.c in the current directory of the local machine to the current directory of the remote ftp server, and change the name to ftp_sample.c.

The brackets indicate that it can be written or not. If it is not written, it will be uploaded with the file name.

 

3. Finally, attach the ftp common commands, as shown below:

 

FTP>open [ftpservername], connect to the specified remote Linux FTP server?

FTP>user [username] [password], log in with the user specified on the remote Linux FTP server?

FTP>pwd, show the current path on the remote Linux FTP server?

FTP>ls, list the directories and files under the current path on the remote Linux FTP server?

FTP>dir, list the directories and files in the current path on the remote Linux FTP server (same as above)?

FTP>mkdir [foldname], create the specified directory under the current path on the remote Linux FTP server?

FTP>rmdir [foldname], delete the specified directory under the current path on the remote Linux FTP server?

FTP>cd [foldname], change the working directory on the remote Linux FTP server?

FTP>delete [filename], delete the specified file on the remote Linux FTP server?

FTP>rename [filename] [newfilename], rename the specified file on the remote Linux FTP server?

FTP>close, disconnect from remote Linux FTP server but keep FTP command parameters prompt?

FTP>disconnect, disconnect from the remote Linux FTP server but keep the FTP command parameter prompt (same as above)?

FTP>bye, end the connection with the remote Linux FTP server.

FTP>quit, to end the connection with the remote Linux FTP server (same as above).

FTP>!, directly from the remote Linux FTP server into the local shell?

FTP>exit, (continued from the previous step) return to the remote Linux FTP server environment from the local shell environment?

 

FTP>!ls, list the directories and files in the current path on the local machine?

FTP>lcd [foldname], change the working directory of the local machine?

 

FTP>?, show ftp command description?

FTP>help, display the ftp command description (same as above)?

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326946265&siteId=291194637