Unix: Flexibly moving files with lftp

Moving files between Linux (and other) servers is a lot smarter and more versatile when you discover lftp.

By  

Typing mirror images, for example, will copy the images folder from the remote system
and create one in your local directory, complete with images and subdirectories if they exist. Use a second argument if you want to give your local folder a different name.

Once you've logged off, you can look through your .lftp directory and peruse the history (cwd_history) file that was left there showing the sites you visited and the rl_history file to see what commands you issued and files you downloaded.

cd .lftp
ls -l
-rw------- 1 sandrahs dweebs    43 Sep  1 17:43 cwd_history
-rw------- 1 sandrahs dweebs   252 Sep  1 17:43 rl_history
-rw------- 1 sandrahs dweebs 18554 Sep  1 17:02 transfer_log
$ cat cwd_history
ftp://sandrahs@ftp.targetsite.com   1378071811:/
$ cat rl_history
lftp ftp.targetsite.com
user sandrahs NotMyRealPassword
mirror images
quit
$ cat transfer_log
2013-09-01 17:00:43 ftp://sandrahs:NotMyRealPassword@ftp.targetsite.com
/images/mugshot.jpg 0-629374 557.7K/s
2013-09-01 17:00:44 ftp://sandrahs:NotMyRealPassword@ftp.targetsite.com
/images/myhome.jpg 0-87454 893.1K/s

Moving files around deftly, reliably and securely has just gotten easier. I'm impressed with this limber, lithe, liberal and, ok, sophisticated ftp tool.

Read more of Sandra Henry-Stocker's Unix as a Second Language blog and follow the latest IT news at ITworld, Twitter and Facebook.

Photo Credit: 

flickr / hbp_pix

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Answers - Powered by ITworld

ITworld Answers helps you solve problems and share expertise. Ask a question or take a crack at answering the new questions below.

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+

Ask a Question
randomness