Linux ftp command line download get and upload put command details

  • 2020-06-23 02:22:11
  • OfStack

Description: Remotely log in via ftp to the 192.168.0.6 ftp server from the local machine logged in as user anok with the login username peo. The following is an experiment to use this connection.

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

1. Command format for downloading files from remote ftp server:

File name to download under current directory on get remote ftp server [file name to download when current directory on local machine], such as:


get nmap_file [nmap]

Download the file nmap_file from the remote ftp server to the current directory of the local machine and change the name to nmap.

The parenthesis indicates that you can write or not. If not, you will download the file name.

If you want to upload files to the ftp server, you need to modify the configuration file of vsftpd under 1. vsftpd.conf under /etc. To remove and save the # before #write_enable=YES and restart the vsftpd service:


sudo service vsftpd restart .  

2. Command format for uploading files to remote ftp server:

File name to be uploaded under current directory on put local machine [file name to be uploaded to current directory on remote ftp server], such as:


put sample.c [ftp_sample.c]

Upload the file smaple.c from the current directory of the local machine to the current directory of the remote ftp server and change the name to ES60en_sample.c.

The parenthesis indicates whether to write or not, and if not, upload with the same file name.

3. Finally, attach ftp common command as follows:

FTP > open [ftpservername], and the specified remote Linux FTP server connection ?
FTP > user [username] [password], login using specified remote Linux FTP server ?
FTP > pwd, display the current path ? on the remote Linux FTP server;
FTP > ls lists the directories and files under the current path on the remote Linux FTP server ?
FTP > dir, lists the directories and files under the current path on the remote Linux FTP server (ibid.)?
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 working directory on remote Linux FTP server ?
FTP > delete [filename], delete the file specified on remote Linux FTP server ?
FTP > rename [filename] [newfilename], renaming the file specified on the remote Linux FTP server ?
FTP > close, disconnect from remote Linux FTP server but keep FTP command parameter prompt ?
FTP > disconnect, disconnect from remote Linux FTP server but keep FTP command parameter prompt (ibid.)?
FTP > bye, ending the connection to the remote Linux FTP server.
FTP > quit, ending the connection to the remote Linux FTP server (ditto).
FTP > ! , directly from the remote Linux FTP server into the local shell ?
FTP > exit, (continuing) from the local shell environment to the remote Linux FTP server environment ?
FTP > ! ls, lists the directories and files under the current path on the local machine ?
FTP > lcd [foldname], change working directory of local machine ?
FTP > The & # 63; , showing ftp command description ?
FTP > help, showing ftp command description (ibid.)?

conclusion


Related articles: