1. login ftp code: lftp user name: password @ ftp address: transfer port (default 21) usage (1) lftpusername: password @ 127001: 21 press enter (2) lftpusername @ 127001 press enter default port 21 press enter and enter password (3) l
1. log on to ftp
Code:
Lftp user name: password @ ftp address: transfer port (default: 21)
Usage
(1) lftp username: password@127.0.0.1: 21 press enter
(2) lftp username@127.0.0.1 press enter # default port 21 press enter and enter the password
(3) lftp 127.0.0.1 carriage return # login after carriage return
(4) lftp press enter --> open 127.0.0.1 --> login
I feel like Kong Yiji, and there are several ways to write "shen" of xiangdou! ~ Really dizzy Ah ~
2. lftp Chinese garbled characters
For beginners like me, what I see after login is Chinese garbled characters (because the local code is usually UTF-8). how can this problem be solved by using the set command?
Set ftp: charset gbk (or gb2312 or UTF-8) # set the ftp encoding format
Set file: charset UTF-8 (... same as above) # set the local encoding format
Appendix: set command skills (1) enter set to view the configured command (2) set-a to view all the commands that can be set clear Network
3. search for ftp files
Ls *. txt # Find all txt files in the current directory
Ls./123/# List all files in the 123 Directory
Find.-name "*. txt" # Recursively search all txt files on the site
Find./xx-name "*. txt" # find all txt files in the xx Directory
Appendix 1: ls reads the local cache for the second time. you can use rels instead of ls or catch off/catch on to switch catch. catch flush clears the local catch.
Appendix 2: commands for viewing local directories are available! Ls, such! Ls/usr/local/bin/
4. download an object
Before downloading an object, you must set a local directory to store the downloaded object.
LCD/home/123/web # set the local storage directory to/home/usr by default
Get 123.txt downloaded to download the 123.txt file to/home/123/web
Get-c 123.txt # resumable download
Mget *. txt # batch download all txt files
Mget-c *. txt # resumable Upload
Mget-c./123/aaa/*. txt # resumable Upload and batch download of all txt files under the aaa directory on the ftp end
Pget-c-n 10 file. dat
# Download file. dat using a maximum of 10 threads to allow resumable data transfer
# You can use the default value by setting the set pget: default-n 5 value.
Mirror aaa/
# Download the entire aaa directory, and the subdirectory will automatically copy the local directory and automatically create the Directory
5. Upload files
Put 123.txt # Same download
Mput *. txt # Same download
Mirror-R aaa/# Same download
6. set passive/non-passive mode
Set ftp: passive-mode 1 #1 passive 0 not active
Multi-task processing
Ctrl + z # hand over the current task to the background for processing
Wait # Move the background processing task to the foreground
Jobs # view the task list in the background
Kill all or job_no # delete all or specified tasks
# Add a task to the task list
Queue get 123.txt
Queue put 234.txt
Queue mirror aaa/
Queue # view the task list
Jobs # view the background task list
Queue start # start Task list
Queue stop # stop a task list
Other commands
Alias []
Define aliases
Alias less more
Alias reconnect "close; cd ."
Enter alias directly to see the aliases currently defined. If you only enter alias name, the alias name is canceled.
Bookmark SUBCMD
Set bookmarks. you can set the current platform and directory as bookmarks. you can click here next time without cd.
Bookmark add name is used to add a new bookmark named name.
Bookmark del name: Delete a bookmarked with name
The bookmark list shows the bookmarks currently configured (in addition, the result of directly playing the bookmark is the same as that of the bookmark list)
Bookmark edit call editor modify bookmarks (~ /. Lftp/bookmarks)
Cd switch remote directory
Cache SUBCMD
Manage lftp cache
Rels []
Display the remote file list from the cache
Rels will not read from the cache
Recls opts [path/] pattern
Display the remote file list from the cache. it should be an enhanced version of ls. There are many parameters available, which should be used to generate various> File lists for use by other programs.
Recls will not read from the cache
Du options
Calculate the capacity occupied by the entire remote directory
Get OPTS-o
Capture remote file clear Network
Get rfile-o lfile
Capture rfile and rename it lfile
-C: Resume
-E. After file capturing is completed, the remote file is cut down.
-A is an ascii mode and the default value is binary mode.
-O sets the base directory as the directory for storing files on the local end.
Mget OPTS
Download the remote file (wildcard expansion is available *)
Pget OPTS-o
You can use multiple links to download five files by default.
-N 3 indicates three links.
Jobs-v
Show which programs are currently executed in the background
-V displays detailed information (-v can add more information to display more detailed information)
LCD
Switch the local directory
Mirror OPTS remote [local]
Download the entire directory (get upstairs can only be used to capture files)
-C resume
-E be careful when comparing remote and local files. if the remote files do not exist, delete the local files, that is, synchronize the local and remote data.
-R: upload the entire directory
-N: only download newer files
-R does not need to be handed back to the directory.
-- Parallel = n download n files simultaneously (only one file is downloaded at a time by default) clear Network
Module name args
Load Module
Put OPTS-o
Upload files
Mput OPTS
Upload a file (wildcard expansion is also available *)
Mv
Rename the remote file1 to file2
Mrm
Use wildcard expansion to delete remote files
Open OPTS
Start a platform
Open-u,-p site
Queue OPTS []
Put cmd in the queue for execution
-D index: delete the job numbered index
-M index new_index: move the job numbered index to new_index, which is dedicated to plug-in.
-N index: Adds a job before the index number.
Wait []
Move the program in background execution to the foreground (fg is also available)
Kill all
Delete all jobs or job_no
Repeat delay command
Execute command again every delay seconds. the default value is every second.
Rm-r-f
Remove remote files
Mkdir-p
Create remote directory
Rmdir-f
Remove remote directory
Set OPT []
Set variable
Directly type set. you can see the variables defined currently.
Source
Read the file and execute the command in file (it should be the same as the source Command in bash)
Debug [| off]-o
Set debug level to level
-O directs the output to file
Exit [| bg]
End lftp
If there are still jobs, lftp will be placed to the background for execution and the unfinished work will continue.
History-w file-r file-c |-l cnt
Like history in bash
Renlist []
Show only remote file names
Pwd-p
Displays the current remote directory
-P: the logon password is displayed.
Scache []
Only use scache to display all current sessions. with session_no, you can switch to other sessions,
Switch between directories on multiple platforms or on the same platform at the same time.