FTP commands are one of the most frequently used commands for Internet users, and they encounter a large number of FTP internal commands, whether they are using FTP under a DOS or UNIX operating system. The familiar and flexible application of FTP internal commands, can greatly facilitate users, and receive a multiplier effect.
The command line format for FTP is: ftp-v-d-i-N-G [hostname], where
-V Displays all the response information for the remote server;
-d use debug mode;
-I limit FTP automatic login, that is, do not use;
-N etrc file;
-G cancels the global file name.
The internal commands used by FTP are as follows (the brackets indicate the optional options):
1.! [Cmd[args]]: Perform interactive shell,exit in the local machine back to the FTP environment, such as:!ls*.zip.
2. $ Macro-ame[args]: Perform macro definition macro-name.
3. Account[password]: Provides the additional password required to access system resources after a successful login to the remote system.
4.append Local-file[remote-file]: Appends the local file to the remote system host and uses the local file name if the remote system file name is not specified.
5. ASCII: Use ASCII type transfer mode.
6. Bell: The computer rings once after each command has been executed.
7. Bin: Use a binary file transfer method.
8. Bye: Exits the FTP session process.
9. Case: When using Mget, capitalize the remote host file name into lowercase letters.
CD Remote-dir: Enter the remote host directory.
Cdup: Enter the parent directory of the remote host directory.
chmod mode file-name: Sets the remote host file File-name access mode to mode, such as chmod 777 a.out.
Close: Interrupts the FTP session with the remote server (corresponding to open).
CR: Converts a carriage return to a return line when transferring a file using the Asscii method.
Delete remote-file: Deletes the remote host file.
Debug[debug-value]: Set debug mode, display each command sent to the remote host, such as: Deb up 3, if set to 0, means cancel Debug.
17.dir[remote-dir][local-file]: Displays the remote host directory and stores the results in local file local-file.
Disconnection: With close.
Form format: Sets the file transfer mode to format, which is the default.
Get Remote-file[local-file]: Transfer the remote host's file Remote-file to the local-file of the local hard disk.
Glob: Sets the file name extension of Mdelete,mget,mput, by default does not extend the file name, the same as the command line-G parameter.
Hash: 1024 bytes per transmission, showing a hash symbol (#).
Help[cmd]: Displays the help information for the FTP internal command cmd, such as: get.
Idle[seconds]: Sets the remote server's sleep timer to [seconds] seconds.
Image: Set binary transfer mode (same binary).
LCD[DIR]: Switch the local working directory to dir.
Ls[remote-dir][local-file]: Displays the remote directory Remote-dir and deposits the local file local-file.
Macdef Macro-name: Defines a macro that ends when an empty row is encountered under Macdef.
Mdelete[remote-file]: Deletes the remote host file.
Mdir remote-files Local-file: Similar to dir, but multiple remote files can be specified, such as: Mdir *.o.*.zipoutfile.
Mget remote-files: Transfer multiple remote files.
mkdir dir-name: Build a directory in the remote host.
Remote-file MLS Local-file: Same as nlist, but multiple file names can be specified.
Mode[modename]: Set the file transfer mode to Modename, the default is stream mode.
Modtime file-name: Displays the last modified time of the remote host file.
Mput local-file: Transfer multiple files to a remote host.
Newer file-name: If the File-name modification time in the remote machine is closer than the time of the local hard disk file name, the file is re-transmitted.
Nlist[remote-dir][local-file]: Displays the list of files for the remote host directory and deposits the local-file of the local hard disk.
Nmap[inpattern Outpattern]: Sets the file name Mapping mechanism so that when files are transferred, some characters in the file are converted to each other, such as: Nmap $1.$2.$3[$1,$2]. [$2,$3], when the file a1.a2.a3 is transferred, the filename becomes a1,a2. This command is especially useful for cases where the remote host is not a UNIX machine.
Ntrans[inchars[outchars]]: Sets the translation mechanism of the filename character, such as NTRANS1R, and the file name lll becomes the RRR.
Open Host[port]: establishes the specified FTP server connection, which specifies the connection port.
Passive: Enter passive transmission mode.
Prompt: Interactive tips for setting up multiple file transfers.
Proxy Ftp-cmd: In the secondary control connection, execute an FTP command that allows you to connect two FTP servers to transfer files between two servers. The first FTP command must be open to establish a connection between two servers first.
Put Local-file[remote-file]: transfers The local file Local-file to the remote host.
A. PWD: Displays the current working directory of the remote host.
Quit: With bye, exit the FTP session.
Quote Arg1,arg2 ... : The parameters are sent verbatim to the remote FTP server, such as: Quote Syst.
Recv Remote-file[local-file]: Same as get.
Reget Remote-file[local-file]: similar to get, but if local-file exists, it is resumed from the last transmission interrupt.
Rhelp[cmd-name]: Request help for remote host.
Rstatus[file-name]: If a file name is not specified, the status of the remote host is displayed, otherwise the file status is displayed.
Rename[from][to]: Change the remote host file name.
Reset: Clears the answer queue.
Restart marker: From the specified flag marker, restart get or put, such as: Restart 130.
RmDir dir-name: Delete the remote host directory.
Runique: Sets the file name uniqueness store.
. Send Local-file[remote-file]: same as put.
SendPort: Sets the use of the port command.
Site Arg1,arg2 ... : sends the parameter verbatim to the remote FTP host as the site command.
Size File-name: Displays the remote host file size, such as: Site Idle 7200.
Status: Displays the current FTP status.
Struct[struct-name]: Sets the file transfer structure to struct-name, using the stream structure by default.
Sunique: Sets the remote host file name store to unique (corresponding to Runique).
System: Displays the type of operating system for the remote host.
Tenex: Sets the file transfer type to the desired type of the Tenex machine.
The. Tick: Sets the byte counter at transfer time.
A. Trace: Sets the package trace.
Type[type-name]: Set the file Transfer type to Type-name, default to ASCII, such as: Type binary, set the binary transfer mode.
Umask[newmask]: Set the remote server's default umask to Newmask, such as: Umask 3.
User User-name[password][account]: To identify yourself to the remote host, you must enter a password when a password is required, such as user anonymous [email protected].
Verbose: With the command-line-v parameter, which is to set the detailed reporting method, all the responses of the FTP server will be displayed to the user by default.
73.? [cmd]: With help.
Aid Editor's note: If the server supports it, you can use quote "site PSWD oldpassword newpassword" To change the password
Common commands for FTP-linked servers under Liux