📄 ncftpget.1
字号:
.TH ncftpget 1 "NcFTP Software" ncftpget.SH NAMEncftpget - Internet file transfer program for scripts.SH "SYNOPSIS".PP.B ncftpget.RI [ "options" ].I "remote-host" "local-directory" "remote-files...".PP.B ncftpget-f login.cfg.RI [ "options" ].I "local-directory" "remote-files...".PP.B ncftpget.RI [ "options" ].I "ftp://url.style/host/path/name".\"-------.SH "OPTIONS".\"-------.SSCommand line flags:.TP 8.RI "-u " "XX"Use username.I XXinstead of anonymous..TP 8.RI "-p " "XX"Use password.I XXwith the username..TP 8.RI "-P " "XX"Use port number.I XXinstead of the default FTP service port (21)..TP 8.RI "-d " "XX"Use the file.I XXfor debug logging..TP 8-aUse ASCII transfer type instead of binary..TP 8.RI "-t " "XX"Timeout after.I XXseconds..TP 8-v/-VDo (do not) use progress meters.The default is to use progress meters if the output stream is a TTY..TP 8.RI "-f " "XX"Read the file.I XXfor host, user, and password information..TP 8-AAppend to local files, instead of overwriting them..TP 8-z/-ZDo (do not) try to resume transfers.The default is to try to resume (\-z)..TP 8-FUse passive (PASV) data connections..TP 8-DDDelete remote file after successfully downloading it..TP 8-RRecursive mode; copy whole directory trees..TP 8.RI "-r " "XX"Redial a maximum of .I XXtimes until connected to the remote FTP server..\"-------.SH "DESCRIPTION".\"-------.PPThepurpose of.I ncftpgetis to do file transfers from the command-linewithout entering an interactive shell.This lets you write shell scripts or other unattendedprocesses that can do FTP.It is also useful for advanced users whowant to retrieve files from the shell command line withoutentering an interactive FTP program such as.IR ncftp ".".PPOne particularly useful feature of this program is thatyou can give it a.I uniform resource locatoras the only argument and the program will downloadthat file.You can then copy and paste from your web browseror newsreader and use that URL.Example:.RS 4.sp$ cd /tmp.br$ ncftpget ftp://ftp.ncftp.com/pub/ncftp/ncftp.tar.Z.br$ zcat ncftp.tar.Z | tar xf -.br.RE.PPBy default the program tries to open the remote hostand login anonymously, but you can specify a usernameand password information.The.B -uoption is used to specify the username to login as,and the.B -poption is used to specify the password.If you are running the program from the shell, you mayomit the.B -poption and the program will prompt you for the password..PPUsing the .B -uand.B -poptions are not recommended, because your account informationis exposed to anyone who can see your shell script or yourprocess information. For example, someone using the.I psprogram could see your password while the program runs..PPYou may use the.B -foption instead to specify a file with the account information.However, this is still not secure because anyone whohas read access to the information file can see theaccount information.Nevertheless, if you choose to use the.B -foption the file should look something like this:.RS 4.sphost Bozo.probe.net.bruser gleason.brpass mypasswd.br.sp.REDon't forget to change the permissions on this fileso no one else can read them..PPThe.B -doption is very useful when you are trying to diagnosewhy a file transfer is failing.It prints out theentire FTP conversation to the file you specify, soyou can get an idea of what went wrong. If you specify the special name.I stdoutas the name of the debugging output file, the outputwill instead print to the screen. Example:.RS 4.sp$ ncftpget -d stdout ftp.ncftp.com . /pub/ncftp/README.br220: ftp.ncftp.com FTP server ready..brConnected to ftp.ncftp.com..brCmd: USER anonymous.br331: Guest login ok, send your complete e-mail address as password..brCmd: PASS xxxxxxxx.br230: Welcome!.brLogged in to ftp.ncftp.com as anonymous..brCmd: TYPE I.br200: Type set to I..brCmd: SIZE /pub/ncftp/README.br550: /pub/ncftp/README: not a plain file..brCmd: MDTM /pub/ncftp/README.br550: /pub/ncftp/README: No such file or directory..brCmd: PORT 192,168,1,17,6,76.br200: PORT command successful..brCmd: RETR /pub/ncftp/README.br550: /pub/ncftp/README: No such file OR directory..brncftpget: file retrieval error: could not start data transfer..brCmd: QUIT.br221: Goodbye..br.RE.PPUsing ASCII mode is helpful when the text format of your hostdiffers from that of the remote host.For example, if you are retrieving a \.TXT file froma Windows-based host to a UNIX system, you could use the.B -aflag which would use ASCII transfer mode so that the filecreated on the UNIX system would be in the UNIX textformat instead of the MS\-DOS text format..PPYou can retrieve an entire directory tree of files byusing the.B -Rflag.However, this will work only if the remote FTP serveris a UNIX server, or emulates UNIX's list output.Example:.RS 4.sp$ ncftpget -R ftp.ncftp.com /tmp /pub/ncftp.br.sp.REThis would create a /tmp/ncftp hierarchy..\"-------.SH "DIAGNOSTICS".\"-------.PP.I ncftpgetreturns the following exit values:.TP 80Success..TP 81Could not connect to remote host..TP 82Could not connect to remote host - timed out..TP 83Transfer failed..TP 84Transfer failed - timed out..TP 85Directory change failed..TP 86Directory change failed - timed out..TP 87Malformed URL..TP 88Usage error..TP 89Error in login configuration file..TP 810Library initialization failed..TP 811Session initialization failed..\"-------.SH "AUTHOR".\"-------.PPMike Gleason, NcFTP Software (http://www.NcFTP.com)..\"-------.SH "SEE ALSO".\"-------.PP.IR ncftpput (1),.IR ncftp (1),.IR ftp (1),.IR rcp (1),.IR tftp (1)..PP.IR "LibNcFTP" " (http://www.ncftp.com/libncftp/)."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -