get
使用lftp登录ftp服务器之后,可以使用get指令从服务器获取文件。
1
、语法
get [-E] [-a] [-c] [-O base] rfile [-o lfile]
2
、选项列表
|
选项
|
说明
|
|
-o
|
指定输出文件的名字,不指定则使用原来的名字
|
|
-c
|
如果失败,持续获取
|
|
-E
|
获取之后,删除源文件
|
|
-a
|
使用ascii模式
|
|
-O
|
指定输出文件存放的目录
|
3
、实例
1
)获取文件,指定存储的名字
|
[root@localhost weijie]#
lftp 192.168.1.8 //
登录
ftp
服务器
lftp 192.168.1.8:~>
ls
drwxr-xr-x 2 0 0 4096 Aug 14 06:38 pub
lftp 192.168.1.8:/>
cd pub/ //
切换目录
lftp 192.168.1.8:/pub>
ls //
查看文件
-rwxrwxrwx 1 0 0 2375494044 Aug 14 06:38 1.zip
-rw-r--r-- 1 0 0 0 Aug 14 03:38 test.c
lftp 192.168.1.8:/pub>
get test.c -o testtt.c //
获取文件,存储名字为
testtt.c
lftp 192.168.1.8:/pub>
quit //
退出
[root@localhost weijie]#
ls //
查看内容,已经获取到文件。文件存储在当前目录
1 11.c 1.zip 2.c.bz2 4.c 6.c~ rec000012.c.bz2 testtt.c
1. 1.c 2.c 3.c 5.c col res.zip
|
2
)获取文件,指定存储位置
|
[root@localhost weijie]#
lftp 192.168.1.8 //
登录服务器
lftp 192.168.1.8:~>
cd pub/ //
切换目录
lftp 192.168.1.8:/pub>
get -O / test.c //
获取文件,指定存储位置到根目录
lftp 192.168.1.8:/pub>
quit //
退出
[root@localhost weijie]#
ls / //
查看更目录,已经得到文件
bak dev lib misc opt sbin sys usr wj
bin etc lost+found mnt proc selinux
test.c
var
boot home media net root srv tmp weijie
|
做了一个Linux学习的平台,目前出来一个雏形,各位可以参考使用
链接:
https://pan.baidu.com/s/1GOLVU2CbpBNGtunztVpaCQ
密码:n7bk
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29270124/viewspace-2639177/
,如需转载,请注明出处,否则将追究法律责任。