當前位置:首頁 » 文件管理 » linuxftp命令

linuxftp命令

發布時間: 2022-01-31 12:19:48

linux只安裝vsftpd就能使用ftp命令

linux不需要安裝vxftpd也可以使用ftp命令(FTP客戶端)。

在大多發行版都有打包,請到各大發行版的ftp列表中得到,或者在發行版的安裝盤中也能得到。lftp是一個命令行式的ftp客戶端。對中文支持較好。如果您在linux 的text模式下,要安裝zhcon或者cce之類的。

安裝:

1、RPM包管理的系統,請到

http://freshrpms.net
http;//rpmfind.net 上查找lftp的最新包,可以用

#rpm -ivh name.rpm
#rpm -Uvh name.rpm 這是升級之用

2、源碼包安裝舉例:lftp-3.2.0.tar.bz2

#tar zxvf lftp-3.2.0.tar.bz2
#cd lftp-3.2.0
#./configure
#make
#make install

3.調用方法:

lftp ftp://用戶名:密碼@地址

比如:
[beinan@S01~]$lftp ftp://[email protected]
口令:
lftp [email protected]:~>
lftp [email protected]:~>ls

-rw-r--r-- 1 1000 100 44387 May 18 10:04 xvmain.jpg
-rw-r--r-- 1 1000 100 202643 May 18 09:45 xxx.jpeg
-rw-r--r-- 1 1000 100 0 May 20 10:01 鯊魚的故事.txt

二、使用方法:

0.簡單的用法:lcd 切換本地目錄,比如 lcd /opt
get 取回一個文件,put 向ftp伺服器傳文件;

1、獲得幫助:

代碼:

lftp [email protected]:~> help
!<shell-command>(commands)
alias [<name> [<value>]]anon
bookmark [SUBCMD] cache [SUBCMD]
cat [-b] <files>cd <rdir>
chmod [OPTS] mode file... close [-a]
[re]cls [opts] [path/][pattern] debug [<level>|off] [-o <file>]
[options] <dirs> exit [<code>|bg]
get [OPTS] <rfile> [-o <lfile>] glob [OPTS] <cmd> <args>
help [<cmd>]history -w file|-r file|-c|-l [cnt]
jobs [-v] kill all|<job_no>
lcd <ldir>lftp [OPTS] <site>
ls [<args>] mget [OPTS] <files>
mirror [OPTS] [remote [local]]mkdir [-p] <dirs>
mole name [args]more <files>
mput [OPTS] <files> mrm <files>
mv <file1> <file2>[re]nlist [<args>]
open [OPTS] <site>pget [OPTS] <rfile> [-o <lfile>]
put [OPTS] <lfile> [-o <rfile>] pwd [-p]
queue [OPTS] [<cmd>]quote <cmd>
repeat [delay] [command]rm [-r] [-f] <files>
rmdir [-f] <dirs> scache [<session_no>]
set [OPT] [<var> [<val>]] site <site_cmd>
source <file> user <user|URL> [<pass>]
version wait [<jobno>]
zcat <files>zmore <files>

如果針對lftp的每個命令的幫助,應該是:

lftp [email protected]:~> help 命令

比如

代碼:
lftp [email protected]:~> help get

用法: get [OPTS] <rfile> [-o <lfile>]

Retrieve remote file <rfile> and store it to local file <lfile>.
-o <lfile> specifies local file name (default - basename of rfile)
-ccontinue, reget
-Edelete remote files after successful transfer
-ause ascii mode (binary is the default)
-O <base> specifies base directory or URL where files should be placed

簡介:gftp基於gtk的ftp客戶端,大家用的也比較多吧,支持中文目錄。如果您的gftp不能支持中文,請升級版本。

# Written in C and has a text interface and a GTK+ 1.2/2.x interface
# Supports the FTP, FTPS (control connection only), HTTP, HTTPS, SSH and FSP protocols
# FTP and HTTP proxy server support
# Supports FXP file transfers (transferring files between 2 remote servers via FTP)
# Supports UNIX, EPLF, Novell, MacOS, VMS, MVS and NT (DOS) style directory listings
# Bookmarks menu to allow you to quickly connect to remote sites

下載安裝:

在各大發行版中,都有gftp的打包,可以用各發行版自帶的工具來安裝。我只說源碼包安裝:

源碼包安裝,通用於所有發行版,舉例說明:gftp-2.0.18.tar.bz2

代碼:
[root@S01ftp]#ls -lh

總用量 1.4M

-rw-r--r--1 root root 1.4M 2005-05-21 09:18 gftp-2.0.18.tar.bz2
[root@S01ftp]#tar jxvf gftp-2.0.18.tar.bz2
[[email protected]]#./configure
[[email protected]]#make
[[email protected]]#make install

註:因為gftp依賴gtk,如果不能make過去,您應該指定PKG_CONFIG_PATH

[[email protected]]# export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig

調用:

代碼:

[[email protected]]#gftp

② linux 下面怎麼使用ftp 命令

如果你知道你需要訪問的ftp的地址的話,直接使用ftp就可以了
ftp IP地址
然後他會提示你輸入用戶名和密碼,輸入正確就登錄ftp了
然後就可以通過put和get命令上傳和下載文件了

③ Linux 下ftp命令問題。

# $1 = Remote host
# $2 = Remote user
# $3 = Remote password
# $4 = Remote directory
ftp -n -i << EOF
open $1
user $2 $3
cd $4
ls
close
bye
EOF

# $1 = FTP host
# $2 = FTP user
# $3 = FTP password
# $4 = 1st directory/file name
# $5 = 2nd directory/file name
# $6 = get / put
ftp -n -i << EOF
open $1
user $2 $3
binary
$6 $4 $5
close
bye
EOF

④ linux如何用 ftp 命令實現把一個文件傳到伺服器裡面的某個文件夾

put 只能上傳單個文件,
如果要上傳文件夾,就用 mirror命令
mirror -R file

⑤ linux 使用ftp命令 提示沒有命令是怎麼回事 限制的那個文件root是帶#的 v什麼

ftp可以與windows上傳和下載文檔使用的一個命令,呵呵。在cmd中,輸入ftp即可開始連接,詳細方法可以參考其他文檔。

⑥ linux ftp 命令 mdelete *.txt報錯

必須獲得文件列表,然後針對文件列表進行刪除,所有FTP軟體都是這么做的,都是先獲取文件列表,並生成數組。
每次操作後都要刷新文件列表。

在FTP里help一下mdelete命令,看看文件格式吧。
先執行prompt命令,然後再mdelete
到當前路徑執行 mdelete *.fileName
或者直接執行delete *.txt

最簡單的辦法就是找個ftp客戶端軟體登陸上去全選刪除。

或這個給你個腳本,試試吧,這是linux下的腳本,把中文的地方改成相應的東西,復制一下,在linux里vi一個新文件,粘貼,保存退出,直接./新文件名就自動執行了

while read filename(你的文件列表文件名)
do
ftp -i -n 伺服器ip <<EOF
cd 目錄
delete $filename
quit
EOF

done <

⑦ 我的linux里沒有ftp命令.怎麼安裝

Linux中的ftp伺服器一般是安裝vsftp。以centos為例,具體操作如下: 1、運行yum install vsftpd命令 命令具體的細節如下: [[email protected]]# yum install vsftpd Setting up Install Process Parsing package install arguments Resolving Dep...

⑧ linux下ftp命令詳解

ftp(file transfer protocol)
功能說明:設置文件系統相關功能。
語法:ftp [-dignv][主機名稱或IP地址]
補充說明:FTP是ARPANet的標准文件傳輸協議,該網路就是現今Internet的前身。
參數: 《Linux就該這么學》
-d 詳細顯示指令執行過程,便於排錯或分析程序執行的情形。

-i 關閉互動模式,不詢問任何問題。
-g 關閉本地主機文件名稱支持特殊字元的擴充特性。
-n 不使用自動登陸。
-v 顯示指令執行過程。
1. 連接ftp伺服器
格式:ftp [hostname| ip-address]
a)在linux命令行下輸入:
ftp 192.168.1.1
b)伺服器詢問你用戶名和密碼,分別輸入用戶名和相應密碼,待認證通過即可。
c)也可以先輸入ftp
ftp>
d)然後在輸入要連接的IP
ftp>open 192.168.1.1
2. 下載文件
下載文件通常用get和mget這兩條命令。
a) get
格式:get [remote-file] [local-file]
將文件從遠端主機中傳送至本地主機中。
如要獲取遠程伺服器上/usr/your/1.htm,則
ftp> get /usr/your/1.htm 1.htm (回車)

b) mget
格式:mget [remote-files]
從遠端主機接收一批文件至本地主機。
如要獲取伺服器上/usr/your/下的所有文件,則
ftp> cd /usr/your/
ftp> mget *.* (回車)

此時每下載一個文件,都會有提示。如果要除掉提示,則在mget *.* 命令前先執行:prompt off
注意:文件都下載到了linux主機的當前目錄下。比如,在/usr/my下運行的ftp命令,則文件都下載到了/usr/my下。
3.上傳文件
a) put
格式:put local-file [remote-file]
將本地一個文件傳送至遠端主機中。
如要把本地的1.htm傳送到遠端主機/usr/your,並改名為2.htm
ftp> put 1.htm /usr/your/2.htm (回車)

b) mput
格式:mput local-files
將本地主機中一批文件傳送至遠端主機。
如要把本地當前目錄下所有html文件上傳到伺服器/usr/your/ 下
ftp> cd /usr/your (回車)
ftp> mput *.htm(回車)

熱點內容
怎麼查看電腦配置性能 發布:2024-10-20 21:04:31 瀏覽:844
ue4編譯緩存 發布:2024-10-20 20:52:27 瀏覽:56
傳奇留言腳本 發布:2024-10-20 20:52:14 瀏覽:934
c語言一般 發布:2024-10-20 20:31:42 瀏覽:977
Sand編譯器舊版 發布:2024-10-20 20:30:26 瀏覽:441
return在c語言中的用法 發布:2024-10-20 20:00:37 瀏覽:988
浩順考勤機怎伺服器ip 發布:2024-10-20 19:52:41 瀏覽:295
以文本格式存儲的數字 發布:2024-10-20 19:35:04 瀏覽:669
網易雲音樂聽完歌自動緩存怎麼辦 發布:2024-10-20 19:30:54 瀏覽:175
將dll緩存到內存中 發布:2024-10-20 19:30:43 瀏覽:624