TrumanWong

ftp

Used to set file system related functions

Supplementary instructions

ftp command is used to set file system related functions. FTP servers are more common on the Internet. The function of the Linux ftp command is to use commands to control the transfer of files between the local machine and the remote machine. Here is a detailed introduction to some commonly used commands of the Linux ftp command. I believe you can master these using Linux. FTP operations will be very easy.

grammar

ftp(options)(parameters)

Options

-d: Display the instruction execution process in detail to facilitate troubleshooting or analysis of program execution;
-i: Turn off interactive mode and do not ask any questions;
-g: Turn off the extended feature of supporting special characters in local host file names;
-n: Do not use automatic login;
-v: Display the instruction execution process.

Parameters

Host: Specify the host name or IP address of the FTP server to connect to.

Example

ftp> ascii # Set to transmit files in ASCII mode (default value)
ftp> bell # Alarm prompt every time a file transfer is completed.
ftp> binary # Set to transfer files in binary mode.
ftp> bye # Terminate the host FTP process and exit FTP management mode.
ftp> case # When ON, the file names copied using the MGET command are copied to the local machine and all are converted to lowercase letters.
ftp> cd # Same as UNIX CD command.
ftp> cdup # Return to the previous directory.
ftp> chmod # Change file permissions on the remote host.
ftp> close # Terminate the remote FTP process and return to the FTP command state. All macro definitions will be deleted.
ftp> delete # Delete files in the remote host.
ftp> dir [remote-directory] [local-file] # List the files in the current remote host directory. If there are local files, write the results to the local files.
ftp> get [remote-file] [local-file] # Transfer from the remote host to the local host.
ftp> help [command] # Output the explanation of the command.
ftp> lcd # Change the working directory of the current local host. If default, go to the HOME directory of the current user.
ftp> ls [remote-directory] [local-file] # Same as DIR.
ftp> macdef # Define macro commands.
ftp> mdelete [remote-files] # Delete a batch of files.
ftp> mget [remote-files] # Receive a batch of files from the remote host to the local host.
ftp> mkdir directory-name # Create a directory on the remote host.
ftp> mput local-files # Transfer a batch of files from the local host to the remote host.
ftp> open host [port] # Re-establish a new connection.
ftp> prompt # Interactive prompt mode.
ftp> put local-file [remote-file] # Transfer a local file to the remote host.
ftp> pwd # List the current remote host directory.
ftp> quit # Same as BYE.
ftp> recv remote-file [local-file] # Same as GET.
ftp> rename [from] [to] # Change the file name in the remote host.
ftp> rmdir directory-name # Delete the directory on the remote host.
ftp> send local-file [remote-file] # Same as PUT.
ftp> status # Display the current FTP status.
ftp> system # Display the remote host system type.
ftp> user user-name [password] [account] # Log in to the remote host again with another user name.
ftp> ? [command] # Same as HELP. [command] specifies the name of the command that requires help. If command is not specified, ftp will display a list of all commands.
ftp> ! # Exit from the ftp subsystem to the shell.

FTP anonymous login account password

Account: anonymous
Password: anonymous@

Close FTP connection

bye
exit
quit

download file

ftp> get readme.txt # Download readme.txt file
ftp> mget *.txt # Download

upload files

ftp> put /path/readme.txt # Upload readme.txt file
ftp> mput *.txt # Multiple files can be uploaded