㈠ 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
㈡ FTP常用命令有哪些
FTP命令是Internet用戶使用最頻繁的命令之一,不論是在DOS還是UNIX操作系統下使用FTP,都會遇到大量的FTP內部命令。熟悉並靈活應用FTP的內部命令,可以大大方便使用者,並收到事半功倍之效。
FTP的命令行格式為:ftp -v -d -i -n -g [主機名],其中
-v顯示遠程伺服器的所有響應信息;
-n限制ftp的自動登錄,即不使用;
.n etrc文件;
-d使用調試方式;
-g取消全局文件名。
ftp使用的內部命令如下(中括弧表示可選項):
1.![cmd[args]]:在本地機中執行交互shell,exit回到ftp環境,如:!ls*.zip.
2.$ macro-ame[args]:執行宏定義macro-name.
3.account[password]:提供登錄遠程系統成功後訪問系統資源所需的補充口令。
4.append local-file[remote-file]:將本地文件追加到遠程系統主機,若未指定遠程系統文件名,則使用本地文件名。
5.ascii:使用ascii類型傳輸方式。
6.bell:每個命令執行完畢後計算機響鈴一次。
7.bin:使用二進制文件傳輸方式。
8.bye:退出ftp會話過程。
9.case:在使用mget時,將遠程主機文件名中的大寫轉為小寫字母。
10.cd remote-dir:進入遠程主機目錄。
11.cp:進入遠程主機目錄的父目錄。
12.chmod mode file-name:將遠程主機文件file-name的存取方式設置為mode,如:chmod 777 a.out。
13.close:中斷與遠程伺服器的ftp會話(與open對應)。
14.cr:使用asscii方式傳輸文件時,將回車換行轉換為回行。
15.delete remote-file:刪除遠程主機文件。
16.debug[debug-value]:設置調試方式,顯示發送至遠程主機的每條命令,如:deb up 3,若設為0,表示取消debug。
17.dir[remote-dir][local-file]:顯示遠程主機目錄,並將結果存入本地文件local-file。
18.disconnection:同close。
19.form format:將文件傳輸方式設置為format,預設為file方式。
20.get remote-file[local-file]:將遠程主機的文件remote-file傳至本地硬碟的local-file。
21.glob:設置mdelete,mget,mput的文件名擴展,預設時不擴展文件名,同命令行的-g參數。
22.hash:每傳輸1024位元組,顯示一個hash符號(#)。
23.help[cmd]:顯示ftp內部命令cmd的幫助信息,如:help get。
24.idle[seconds]:將遠程伺服器的休眠計時器設為[seconds]秒。
25.image:設置二進制傳輸方式(同binary)。
26.lcd[dir]:將本地工作目錄切換至dir。
27.ls[remote-dir][local-file]:顯示遠程目錄remote-dir,並存入本地文件local-file。
28.macdef macro-name:定義一個宏,遇到macdef下的空行時,宏定義結束。
29.mdelete[remote-file]:刪除遠程主機文件。
30.mdir remote-files local-file:與dir類似,但可指定多個遠程文件,如:mdir *.o.*.zipoutfile
31.mget remote-files:傳輸多個遠程文件。
32.mkdir dir-name:在遠程主機中建一目錄。
33.mls remote-file local-file:同nlist,但可指定多個文件名。
34.mode[modename]:將文件傳輸方式設置為modename,預設為stream方式。
35.modtime file-name:顯示遠程主機文件的最後修改時間。
36.mput local-file:將多個文件傳輸至遠程主機。
37.newer file-name:如果遠程機中file-name的修改時間比本地硬碟同名文件的時間更近,則重傳該文件。
38.nlist[remote-dir][local-file]:顯示遠程主機目錄的文件清單,並存入本地硬碟的local-file。
39.nmap[inpattern outpattern]:設置文件名映射機制,使得文件傳輸時,文件中的某些字元相互轉換,如:nmap $1.$2.$3[$1,$2].[$2,$3],則傳輸文件a1.a2.a3時,文件名變為a1,a2。該命令特別適用於遠程主機為非UNIX機的情況。
40.ntrans[inchars[outchars]]:設置文件名字元的翻譯機制,如ntrans 1R,則文件名LLL將變為RRR。
41.open host[port]:建立指定ftp伺服器連接,可指定連接埠。
42.passive:進入被動傳輸方式。
43.prompt:設置多個文件傳輸時的交互提示。
44.proxy ftp-cmd:在次要控制連接中,執行一條ftp命令,該命令允許連接兩個ftp伺服器,以在兩個伺服器間傳輸文件。第一條ftp命令必須為open,以首先建立兩個伺服器間的連接。
45.put local-file[remote-file]:將本地文件local-file傳送至遠程主機。
46.pwd:顯示遠程主機的當前工作目錄。
47.quit:同bye,退出ftp會話。
48.quote arg1,arg2...:將參數逐字發至遠程ftp伺服器,如:quote syst.
49.recv remote-file[local-file]:同get。
50.reget remote-file[local-file]:類似於get,但若local-file存在,則從上次傳輸中斷處續傳。
51.rhelp[cmd-name]:請求獲得遠程主機的幫助。
52.rstatus[file-name]:若未指定文件名,則顯示遠程主機的狀態,否則顯示文件狀態。
53.rename[from][to]:更改遠程主機文件名。
54.reset:清除回答隊列。
55.restart marker:從指定的標志marker處,重新開始get或put,如:restart 130。
56.rmdir dir-name:刪除遠程主機目錄。
57.runique:設置文件名唯一性存儲,若文件存在,則在原文件後加後綴..1,.2等。
58.send local-file[remote-file]:同put。
59.sendport:設置PORT命令的使用。
60.site arg1,arg2...:將參數作為SITE命令逐字發送至遠程ftp主機。
61.size file-name:顯示遠程主機文件大小,如:site idle 7200。
62.status:顯示當前ftp狀態。
63.struct[struct-name]:將文件傳輸結構設置為struct-name,預設時使用stream結構。
64.sunique:將遠程主機文件名存儲設置為唯一(與runique對應)。
65.system:顯示遠程主機的操作系統類型。
66.tenex:將文件傳輸類型設置為TENEX機的所需的類型。
67.tick:設置傳輸時的位元組計數器。
68.trace:設置包跟蹤。
69.type[type-name]:設置文件傳輸類型為type-name,預設為ascii,如:type binary,設置二進制傳輸方式。
70.umask[newmask]:將遠程伺服器的預設umask設置為newmask,如:umask 3。
71.user user-name[password][account]:向遠程主機表明自己的身份,需要口令時,必須輸入口令,如:user anonymous my@email。
72.verbose:同命令行的-v參數,即設置詳盡報告方式,ftp伺服器的所有響應都將顯示給用戶,預設為on.
73.?[cmd]:同help。
㈢ 如何在計算機上建立使用DOS命令通過FTP進行上傳和下載
1、dos命令,是dos操作系統的命令,是一種面向磁碟的操作命令,主要包括目錄操作類命令、磁碟操作類命令、文件操作類命令和其它命令。
2、常用命令:
(1)查看目錄內容命令
dir
(2)指定可執行文件搜索目錄
path
(3)創建目錄命令
md
(4)打開指定目錄命令
cd
(5)刪除當前指定的子目錄命令
rd
(6)改變當前盤符命令
c:
(7)文件復制命令
(8)顯示文本文件內容命令
type
(9)更改文件名命令
ren
(10)刪除文件命令
del
(11)清除屏幕命令
cls
㈣ 360殺毒系統盤下有一批處理重啟後再生成,不知是什麼意思,求大俠幫助!!!內容如下
朋友的這個問題可以使用360系統系統急救箱在安全模式下來進行急救修復。
㈤ chrome 訪問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
㈥ VB下如何將兩個text框中的內容發送到指定的ftp空間高分急求。。。。。。
添加一個internet transfer 控制項和一個按鈕兩個文本框,然後粘貼一下代碼即可,不明白的網路HI我
Private Sub Command1_Click()
Dim UserName As String
Dim PassWord As String
Inet1.Cancel
Inet1.Protocol = icFTP
UserName = "target" 'FTP用戶名,自己修改成需要的
PassWord = "vxTarget" 'FTP密碼,自己修改成需要的
Dim Host As String
Host = "127.0.0.1" '主機地址,自己修改成需要的
Dim ph As String
ph = App.Path
If Right(ph, 1) <> "\" Then ph = ph & "\"
Open ph & "1.txt" For Output As #1
Print #1, Text1.Text;
Close #1
Open ph & "2.txt" For Output As #2
Print #2, Text2.Text;
Close #2
Me.Cls
Print "上傳中,請等待"
Command1.Enabled = False
Inet1.Execute "ftp://" & UserName & ":" & PassWord & "@" & Host, "SEND """ & ph & "1.txt"" 1.txt"
While Inet1.StillExecuting = True
DoEvents '等待
Wend
Inet1.Execute "ftp://" & UserName & ":" & PassWord & "@" & Host, "SEND """ & ph & "2.txt"" 2.txt"
While Inet1.StillExecuting = True
DoEvents '等待
Wend
Kill ph & "1.txt"
Kill ph & "2.txt"
Command1.Enabled = True
MsgBox "完成"
End Sub
㈦ 我打開ftp窗口,輸了很多命令,亂七八糟的,請問怎麼清屏呢
quit
cls
再重新連接。
㈧ 開機後出現bat
簡單一點吧
@echo off
set a=60
:
set /a a=a-1
ping -n 2 -w 500 127.1>nul
cls
echo 倒計時:%a%
if %a%==0 (shutdown.exe -s -t 1) else (goto :)
放在「開始」菜單\程序\啟動 文件夾里
㈨ 批處理命令set及ftp組合使用的問題
set
num==
set
username==
set
message==
這三行是制定發送完畢後,三行數據為空~
也就是清空上面的數據
改成
set
num=,
但個等號的話,是必須賦值的
㈩ VB中使用FTP無法對本地文件進行操作,為什麼
我重新給你一個
模塊(ftp.cls)
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "FTP1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
'******************
'download by http://www.NewXing.com
'*******************
Private Declare Function InternetOpen _
Lib "wininet.dll" _
Alias "InternetOpenA" (ByVal sAgent As String, _
ByVal lAccessType As Long, _
ByVal sProxyName As String, _
ByVal sProxyBypass As String, _
ByVal lFlags As Long) As Long
Private Declare Function InternetConnect _
Lib "wininet.dll" _
Alias "InternetConnectA" (ByVal hInternetSession As Long, _
ByVal sServerName As String, _
ByVal nServerPort As Integer, _
ByVal sUsername As String, _
ByVal sPassword As String, _
ByVal lService As Long, _
ByVal lFlags As Long, _
ByVal lContext As Long) As Long
Private Declare Function FtpGetFile _
Lib "wininet.dll" _
Alias "FtpGetFileA" (ByVal hFtpSession As Long, _
ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, _
ByVal fFailIfExists As Boolean, _
ByVal dwFlagsAndAttributes As Long, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpPutFile _
Lib "wininet.dll" _
Alias "FtpPutFileA" (ByVal hFtpSession As Long, _
ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpDeleteFile _
Lib "wininet.dll" _
Alias "FtpDeleteFileA" (ByVal hFtpSession As Long, _
ByVal lpszFileName As String) As Boolean
Private Declare Function FtpRenameFile _
Lib "wininet.dll" _
Alias "FtpRenameFileA" (ByVal hFtpSession As Long, _
ByVal lpszExsiting As String, _
ByVal lpszNew As String) As Boolean
Private Declare Function InternetCloseHandle _
Lib "wininet.dll" (ByVal hInet As Long) As Integer
Private Declare Function FtpCreateDirectory _
Lib "wininet.dll" _
Alias "FtpCreateDirectoryA" (ByVal hFtpSession&, _
ByVal lpszDirectory$) As Boolean
Dim 連接狀態 As Boolean
Dim 連接句柄 As Long
Public Function 連接伺服器(ip As String, 埠 As Integer, 帳號 As String, 密碼 As String) As Boolean
Dim 初始化 As Long
初始化 = InternetOpen(vbNullString, INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0&)
連接句柄 = InternetConnect(初始化, ip, 埠, 帳號, 密碼, 1, 0, 0)
If 連接句柄 > 0 Then
連接狀態 = True
Else
連接狀態 = False
End If
連接伺服器 = 連接狀態
End Function
Public Function 上傳文件(本地路徑 As String, 遠程路徑 As String) As Boolean
If 連接狀態 = True Then
上傳文件 = FtpPutFile(連接句柄, 本地路徑, 遠程路徑, 1, 0)
Else
MsgBox "請先確認連接"
End If
End Function
Public Function 下載文件(遠程路徑 As String, 本地路徑 As String) As Boolean
If 連接狀態 = True Then
下載文件 = FtpGetFile(連接句柄, 遠程路徑, 本地路徑, False, &H80000000, &H0, 0)
Else
MsgBox "請先確認連接"
End If
End Function
Public Function 刪除文件(遠程路徑 As String) As Boolean
If 連接狀態 = True Then
刪除文件 = FtpDeleteFile(連接句柄, 遠程路徑)
Else
MsgBox "請先確認連接"
End If
End Function
Public Function 創建目錄(ByVal 路徑 As String) As String
If 連接狀態 = True Then
創建目錄 = FtpCreateDirectory(連接句柄, 路徑)
Else
MsgBox "請先確認連接"
End If
End Function
Public Function 文件改名(ByVal 原文件名 As String, ByVal 新文件名 As String)
If 連接狀態 = True Then
ReturnVal& = FtpRenameFile(連接句柄, 原文件名, 新文件名)
Else
MsgBox "請先確認連接"
End If
End Function
窗口調用:
Dim Fffd As FTP1
Set Fffd = New FTP1
Call Fffd.連接伺服器(IP地址, 21, "用戶名", "密碼")
Call Fffd.上傳文件(Mid(文件名, 7))