Home > Article > Operation and Maintenance > What are the ftp commands under linux?
The ftp commands under Linux include: 1. ftp command; 2. close command; 3. disconnect command; 4. open command; 5. user command; 6. account command; 7. bye command; 8. quit command; 9. help command; 10. rhelp command; 11. ascii command; 12. binary/bi command; 13. bell command, etc.
#The operating environment of this tutorial: linux5.9.8 system, Dell G3 computer.
What are the ftp commands under Linux?
Complete set of Linux FTP commands
1, Preface
Below Gives explanations and examples for all commands.
Explanation: 1. remote-file refers to the remote file, that is, the file on the server
2. local-file refers to the local file, that is, the file on the local machine
2. Login and logout commands
2.1 ftp
$ ftp 192.168.0.2
Format: ftp [host]
Host is ftp host ip, this command is used to log in to the ftp server. After logging in, you will be prompted to enter the account and password. After the account and password are entered correctly, you will log in to the server and enter the FTP subroutine.
2.2 close
FTP> close
End the FTP session with the remote server and return to the command interpreter. There is no exit from the ftp subroutine. You can use the open command to log in again.
2.3 disconnect
FTP> disconnect
Disconnect from the remote server, but still within the FTP subcommand, retaining the ftp prompt. disconnect is an alias for close.
2.4 open
FTP >open Connect to the specified FTP server.
Format: open computer [port]
Description: computer specifies the remote computer to be connected. Computers can be specified by IP address or computer name (DNS or hosts file must be available). If autologin is on (default), ftp will also attempt to automatically log the user into the FTP server. port specifies the port number used to contact the FTP server.
Eg: open 192.168.0.2, then enter the server user and password, and log in again.
2.5 user
FTP >user Specify the user of the remote computer. After logging in to the server, you can change the user.
Format: user username [password] [account]
Description: user-name specifies the user name used to log in to the remote computer. password specifies the password for user-name. If not specified, but required, ftp will prompt for a password.
account Specifies the account to use to log in to the remote computer. If account is not specified, but is required, ftp prompts you for an account.
2.6 account
FTP> account
Provide the supplementary password required to access system resources after successfully logging into the remote system
2.7 bye
FTP> bye (or by) Ends the FTP session with the remote computer and exits ftp.
2.8!
FTP> ! End the FTP session with the remote computer and exit ftp. The function is the same as bye.
2.9 quit
FTP >quit End the FTP session with the remote computer and exit ftp.
Remarks: bye,! The function is basically the same as quit.
3. Help command
3.1 ?
FTP>? Display ftp command description, same as help.
Format:? [command]
Description: command specifies the name of the command that requires instructions. If command is not specified, ftp will display a list of all commands.
3.2 help
FTP >help Displays the ftp command description.
Format: help [command]
Description: command specifies the name of the command that requires instructions. If command is not specified, ftp will display a list of all commands.
3.3 rhelp
FTP >remotehelp Display remote command help.
Format: remotehelp [command]
Description: command specifies the name of the command that requires help. If command is not specified, ftp will display a list of all remote commands.
4. File operation commands
4.1 ascii
FTP> ascii
Set the file transfer type to the default ASCII.
Note: FTP supports two file transfer types, ASCII code and binary code (binary). ASCII should be used when transferring text files.
4.2 binary/bi
FTP> binary (or bi) Set the file transfer type to binary.
4.3 bell
FTP> bell
Toggle the bell to sound after each file transfer command completes. By default, ringtones are turned off.
4.4 cd
FTP> cd
Format: cd remote-directory jumps to the remote-directory directory
4.5 cdup
FTP> cdup
Description: Change the directory on the remote computer and jump to the previous directory.
4.6 lcd
FTP >lcd Change the working directory on the local computer.
By default, the working directory is the directory where ftp is started.
Format: lcd [directory]
Description: directory specifies the directory on the local computer to be changed. If directory is not specified, the current working directory on the local computer will be displayed.
4.7 dir
FTP> dir displays a list of remote directory files and subdirectories, the same as the ls command.
Format: dir [remote-directory] [local-file]
Description: remote-directory specifies the directory whose list you want to view. If no directory is specified, the current working directory on the remote machine will be used. Local-file specifies the local file in which to store the list. If not specified, the output will be displayed on the screen.
4.8 ls
FTP >ls displays an abbreviated list of files and subdirectories in a remote directory.
Format: ls [remote-directory] [local-file]
Description: remote-directory specifies the directory whose list you want to view. If no directory is specified, the current working directory on the remote machine will be used. local-file specifies the local file in which to store the list. If not specified, the output will be displayed on the screen.
4.9 mdir
FTP >mdir displays a list of remote directory files and subdirectories. Multiple files can be specified using mdir.
Format: mdir remote-files [...] local-file
Description: remote-files specifies the directory to view the list. remote-files must be specified. Please type - to use the current working directory on the remote machine.
local-file Specifies the local file to restore the list. Please type - to display the list on the screen.
4.10 pwd
FTP >pwd displays the current directory on the remote computer.
4.11 size
FTP> size remote-file
Display the size of the remote file
4.12 mkdir
FTP >mkdir creates a remote directory.
Format: mkdir directory
Description: directory specifies the name of the new remote directory.
4.13 rmdir
FTP >rmdir deletes the remote directory.
Format: rmdir directory
Description: directory specifies the name of the remote directory to be deleted.
4.14 rename
FTP >rename Rename remote files.
Format: rename filename newfilename
Description: filename specifies the file to be renamed. newfilename specifies a new file name.
4.15 mls
FTP >mls Displays an abbreviated list of files and subdirectories in a remote directory.
Format: mls remote-files [...] local-file
Description: remote-files specifies the files to view the list. remote-files must be specified;
Please type - to use the current working directory on the remote computer.
local-file Specifies the local file to store the list. Please type - to display the list on the screen.
4.16 chmod
FTP> chmod 755 remote_file
Description: Change the RWX attribute of the file on the remote directory
4.17 modtime
FTP >modtime remote-file displays the last modification time of the file on the remote server
Format: mput remote-files
Description: remote-files files on the remote computer
4.18 append
FTP>append local-file
Append a local file to a file on the remote computer using the current file type settings
Format: append local-file [remote-file ]
If remote-file is omitted, the local file name will be used as the remote file name.
4.19 send
FTP >send Copies local files to a remote computer using the current file transfer type. Send is the same as put.
Format: send local-file [remote-file]
Description: local-file specifies the local file to be copied. remote-file specifies the name to use on the remote computer. If not specified, the file will be named local-file.
4.20 put
FTP >put Copies local files to the remote computer using the current file transfer type.
Format: put local-file [remote-file]
Description: local-file specifies the local file to be copied.
remote-file specifies the name to be used on the remote computer. If not specified, the file will be named local-file.
4.21 mput
FTP >mput Multiple file transfer, copies local files to a remote computer using the current file transfer type.
Format: mput local-files [...]
Description: local-files specifies the local files to be copied to the remote computer
4.22 get
FTP> get uses the current The file conversion type copies remote files to the local computer.
Format: get remote-file [local-file]
Description: remote-file specifies the remote file to be copied.
Local-file Specifies the name to use on the local computer. If not specified, the file will be named remote-file.
4.23 mget
FTP >mget copies a remote file to the local computer using the current file transfer type.
Format: mget remote-files [...]
Description: remote-files specifies the remote files to be copied to the local computer.
4.24 reget
4.25 recv
FTP >recv Copies remote files to the local computer using the current file transfer type. Recv is the same as get.
Format: recv remote-file [local-file]
Description: remote-file specifies the remote file to be copied.
local-file specifies the name to be used on the local computer. If not specified, the file will be named remote-file.
4.26 newer
FTP >newer remote-filelocal-file Gets the file of the remote server, if the file is newer than the local file
Format: mput remote-file local- file [ ...]
4.27 delete
FTP> delete deletes files on the remote computer.
Format: delete remote-file
Description: remote-file specifies the file to be deleted.
4.28 mdelete
FTP >mdelete Delete files on the remote computer.
Format: mdelete remote-files [...]
Description: remote-files specifies the remote files to be deleted.
4.29 umask
Display the umask value of the remote server
5. File mode command
5.1 case
FTP> case
Trigger remote file name case change function
5.2 ccc
FTP> ccc
5.3 clear
FTP>clear
5.4 cprotect
5.5 form
Set file transfer format
5.6 glob
FTP > ;glob switches filename combinations. The
combination allows the use of wildcard characters (* and ?) in internal file or path names. By default, combining is on.
5.7 hash
FTP >hash Toggles the printing of a digital signature (#) for each data block that has been transferred.
The size of the data block is 2048 bytes. By default, hash symbol printing is turned off.
5.8 idle
5.9 image
5.10 mode
Set the file transfer model, Linux only supports stream mode (stream)
5.11 nmap
Set or cancel the file name mapping mechanism
5.12 nlist
5.13 ntrans
Set or cancel the file name character transformation mechanism
5.14 passive
5.15 private
5.16 prompt
FTP >prompt Switch prompt. If you turn off the prompt when mget and mput transfer all files, Ftp will prompt during multiple file transfers to allow you to selectively retrieve or store files. By default, prompts are on.
5.17 protect
5.18 proxy
Execute an ftp command on the auxiliary control connection
5.19 sendport
Use PORT triggered for each data connection
5.20 quote
FTP >quote Send parameters verbatim to the remote FTP server. A single FTP reply code will be returned.
Quote is the same as literal.
Format: quote argument [...]
Description: argument specifies the parameters to be sent to the FTP server.
5.21 reset
Clear the response queue
5.22 restart
5.23 runique
5.24 safe
Transfer the file Set to security protection mode
5.25 site
5.26 struct
Set the file transfer structure
5.27 sunique
Trigger the remote unique host file Storage function
5.28 tenex
Set tenex file transfer type
5.29 type
FTP >type Set or display the file transfer type.
Format: type [type-name]
Description: type-name specifies the file transfer type. The default setting is ascii. If type-name is not specified, the current type will be displayed.
6. Other commands
6.1 $
FTP> $ macro_name
Run the macro, macro_name is the name of the macro
6.2 macdef
Define macro function
6.3 cr
Trigger carriage return and line feed function
6.4 debug
FTP> debug switches debugging.
When debugging is turned on, every command sent to the remote computer is printed, preceded by the string ">". By default, debugging is turned off.
6.5 trace
FTP >trace switches packet tracing. Trace shows the route of each packet when running the ftp command.
6.6 status
FTP >status Displays the current status of FTP connections and switching.
6.7 rstatus
Display the status of the remote server
6.8 system
Display the remote host type, mainly version and kernel information
6.9 verbose
FTP >verbose Switch verbose mode. If on, all ftp responses will be displayed. After the file transfer is completed, statistical information related to transfer efficiency will be displayed at the same time. By default, verbose is on.
Related recommendations: "Linux Video Tutorial"
The above is the detailed content of What are the ftp commands under linux?. For more information, please follow other related articles on the PHP Chinese website!