Simple and practical FTP commands
FTP is one of the earliest protocols used on the TCP/IP network and the INTERNET. It belongs to the application layer of the network protocol group.
The FTP client can send commands to the server to download files, upload files, and create or change directories on the server.
FTP is often used at work. In fact, it is mainly used to upload and download files. The following lists Common commands:
01. ftp 192.168.0.1# Enter the user name and password to log on to the ftp server
[root@host ~]$ ftp 192.168.0.1Connected to 127.0.0.1.220 (vsFTPd 2.2.2)530 Please login with USER and PASS.530 Please login with USER and PASS.KERBEROS_V4 rejected as an authentication typeName (127.0.0.1:root): ftpuse331 Please specify the password.Password:230 Login successful.Remote system type is UNIX.Using binary mode to transfer files.ftp>
02. ftp> mkdir test# Create a test directory
257 "/d/vas1/ftpuse/test" created
03. ftp> dir# List files and directories, or use the ls-lart command
227 Entering Passive Mode (192.168.0.1,175,195).150 Here comes the directory listing.drwxr-xr-x 2 500 500 4096 Sep 19 07:22 test
04. ftp> cd test# Go To The test directory on the ftp server
250 Directory successfully changed.
05. ftp> LCD/home/test# Locate the local directory
Local directory now /home/test
06. ftp> bin# Two transmission modes: binary (
BinaryOr
Bin),
Ascii(Default)
200 Switching to Binary mode.
07. ftp> put for. py# Uploading local files to the ftp server
local: for.py remote: for.py227 Entering Passive Mode (192.168.0.1,186,68).150 Ok to send data.226 Transfer complete.277 bytes sent in 0.0038 seconds (71 Kbytes/s)
08. ftp> get cmbscmx.zip# Download the ftp server file to your local computer
local: cmmbscmx.zip remote: cmmbscmx.zip227 Entering Passive Mode (192.168.0.1,168,106).150 Opening BINARY mode data connection for cmmbscmx.zip (1046670 bytes).226 Transfer complete.1046670 bytes received in 2.8 seconds (3.7e+02 Kbytes/s)
09. ftp>! Dir# Viewing local files and directories
python shell
10. ftp> LCD./python# Go to the next-level directory
11. ftp> cd ..# Go to the upper-level directory
12. ftp>Rename for. py f. py# Renaming a file
13. ftp> deleteFor. py# Deleting an object
14. ftp> rmdir test# To delete a folder, make sure there are no files or folders in it.
15.Ftp> bye# Exit or use the quit command
221 Goodbye.
16. ftp> help# Help: View All commands
Commands may be abbreviated. Commands are:! cr mdir proxy send$ delete mget sendport siteaccount debug mkdir put sizeappend dir mls pwd statusascii disconnect mode quit structbell form modtime quote systembinary get mput recv suniquebye glob newer reget tenexcase hash nmap rstatus traceccc help nlist rhelp typecd idle ntrans rename usercdup image open reset umaskchmod lcd passive restart verboseclear ls private rmdir ?close macdef prompt runiquecprotect mdelete protect safe
17. ftp> help mkdir# If you use a specific command, add help
rmdir remove directory on the remote machine