Use lftp to upload and download files in Linux

Source: Internet
Author: User

Lftp is Linux in an FTP server compared to the FTP in Windows appears to be more complex, let me summarize the lftp file upload, file download, and file search and other related commands. Lftp connection of several methods, the most commonly used is lftp [email protected], so that you can not enter the password in plain text. 1, lftp [email protected] Enter password2, lftp name:[email protected] Enter3, lftp site Enter login username password4, lftp Enter open site Enter login user name password lftp upload file command upload a single file code as follows copy Code lftp [email protected]@115.47.192.146:/> put Test.txt.put:/root/desktop/New/test:is A directory multiple file upload code as follows copy Code lftp [email protected]@115.47.192.146:/> mput *.txt.The whole station upload code is as follows copy code lftp [email protected]@115.47.192.146:/> mirror-r test./testtotal:1Directory2Files0symlinks New:2Files0symlinkslftp download File command get download single file code below copy code lftp [email protected]@115.47.192.146:/>Gethtml.php8473bytes Transferred Select the download code for an extension in a directory below to copy the code lftp [email protected]@115.47.192.146:/Your directory > Mget *. php[0] Mget *.php &' image_class.php'At 0 (0%) [Making data Connection ...]mget Breakpoint Continuation function code as follows copy Code lftp [email protected]@115.47.192.146:/> mget-c./Your Directory/*. *mget:/root/desktop/new:is a directory[0] mget-c./Your directory/*.* & ' your directory/bus Iness_edit.php ' at 1126 (100%) [Making data Connection ...] Download the entire site code as follows copy code LFTP [email protected]@115.47.192.146:/> Mirror/[0] Mirror/& Download the entire directory code as follows copy code LFT P [email protected]@115.47.192.146:/> Mirror your directory/[1] Mirror your directory/& breakpoint to continue the entire directory code as follows copy Code LFTP [Email prot ected]@115.47.192.146:/> mget-c your directory/*[0] mget-c your directory/* & ' your directory/info_class.php ' at 0 (0%) [Waiting for response ...]                         lftp find File Command ls *.php find the current directory of PHP file code as follows copy code lftp [email protected]@115.47.192.146:/> ls *.phptotal 16  -RW-------1 www 2037 Nov 07:50 cai.php-rw-r--r--1 www www 8473 Oct 25                                      07:52 Html.phpls./admin/Find the file code under the Admin directory as follows to copy code LFTP [email protected]@115.47.192.146:/> ls./admin/total 444 -rw-r--r--1 www www 611 208:46 application.php-rw-r--r--1 www www 391 2 08:47 application_info.php-rw-r--r--1 www ww  W 858 6 banner.php-rw-r--r--1 www www 650 2 08:45 banner_add.php-rw-r--r--1 www www 1026 2 08:45 banner_edit.php-rw-r--r--1 www www 1434 6 08:03 business.ph p-rw-r--r--1 www 788 3 10:01 business_add.php-rw-r--r--1 www www 277 3 1   0:01 business_bigclass_add.php-rw-r--r--1 www www 473 3 10:00am business_bigclass_edit.php-rw-r--r-- 1 www www 484 3 10:00am business_class.php-rw-r--r--1 www www 234 3 09:59 busin           ess_class_del.php-rw-r--r--1 www 1126 3 09:59 business_edit.php-rw-r--r--1 www www 759 3 09:58 business_smallclass_add.php-rw-r--r--1 www www 871 3 10:10 business_smallclas s_edit.php-rw-r--r--1 www www 44402 cai.php-rw-r--r--1 www www 930 Nov 07:59 check_login.phpdrwx R-xr-x 2 www www 4096 10:09 cssls./admin/year*.php Find a PHP file containing year in the admin directory lftp [email protecte      d]@115.47.192.146:/> ls./admin/year*.phptotal 12-rw-r--r--1 www www 651 6 07:57 year.php-rw-r--r--1 www www 401 Jul 09:29 year_add.php-rw-r--r--1 www www 531 4 year_edit.php commonly used commands after the terminal runs the man lftp or log in FTP, enter help to see the command list below we look at the lftp commonly used commands: LS display remote File list (!ls displays a list of local files). The CD switches to the remote directory (LCD switch local directory). Get to download the remote file. Mget Download the remote file (you can use the wildcard character, which is *). Pget uses multiple threads to download remote files with a preset of five. Mirror download/upload (mirror-r)/sync entire directory. Put to upload files. Mput Upload Multiple files (wildcard characters are supported). MV Move remote file (remote file renamed). RM deletes the remote file. MRM deletes multiple remote files (wildcard characters are supported). mkdir establish a remote directory. RMDIR delete the remote directory. The PWD displays the directory where the remote is currently located (LPWD displays the local directory). Du calculates the size of the remote directory! command to execute the local shell (because Lftp does not have lls, it can be replaced by!LS) LCD switch local directory lpwd display local directory alias definition alias bookmark set bookmark. ExitExit FTP shortcut bookmarks 

Use lftp to upload and download files in Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.