|
NAMEcmdftp - command line File Transfer Protocol clientSYNOPSIScmdftp [ [OPTIONS] ] hostnameDESCRIPTIONcmdftp is an alternative client for the File Transfer Protocol.It is quite different from the default ftp(1) client, because it always uses passive mode for all data transfers, has a syntax that mimics the shell, has local and remote mode, supports multiple and recursive file transfers, has more complex commands like copy and move, permits remote and local text file viewing and editing, is able to detect network failures and resume the operation, may resume broken downloads between sessions, has tab completion like the shell for both local and remote file names, and has large file support. The ftp host to connect to must be specified on invocation ( parameter hostname ). First of all, the client will attempt autologin, using information provided in ~/.netrc ; if it fails, or the autologin feature has been disabled ( -n ), a user/password pair must be manually entered. By default, failure to login causes the program to quit; the number of manual login attempts can be altered with the -a option. The cmdftp prompt appears as soon as the login operation completes, and informs the user that the client is ready to receive commands: see COMMANDS: LIST section. The current directory is shown in the prompt if option -P has not been specified. The prompt does not appear at all if the quiet option ( -q ) has been specified. There are many more options that control how cmdftp behaves: see OPTIONS section for a full list and description. Additionally, this client can interface with other programs using environment variables: see ENVIRONMENT section. This program can be easily automated: see USAGE_NOTES section for tips and notes about the cmdftp netrc parser. OPTIONS
ENVIRONMENT
COMMANDS: NOTESYou will see that a lot of the commands resemble in names and behaviour similar Unix commands and shell builtins. However there are differences both in names and behaviour, and expecially on parameter passing (number of parameters are fixed in cmdftp), and in the fact that no command options are allowed.For example, the Unix cp command has an omonymous cp equivalent command in cmdftp; however, cmdftp cp command behaves like cp -r, and source and target must be always specified using exactly two parameters (which may contain wildcards). Commands implementation do not generally rely on external software. The FTP (remote) implementation of the commands has been abstracted so local implementation has been achieved with cost near zero. This has the additional benefit of making cmdftp also suited as a very small rescue tool usable even on broken Unix systems. The e command (edit file) is an exception because it needs a text editor (and an EDITOR env variable set) to work. There is also an exception in the form of the local dir command (get pretty list - introduced recently). This command tries to run "/bin/ls -l". However on failure (you do not have /bin/ls) it uses the consuete internal implementation of the ls command and returns a normal (not pretty) list. COMMANDS: LIST
COMMAND NOTES
USAGE_NOTESSome tips to automate cmdftp:
ESCAPINGThe command line parser, and the cmdftp netrc parser both recognize the same C-like escape sequences. Those are:\a, \b, \f, \n, \t, \v, \xHH, (HH are hex digits) - use to specify a character \OOO, (OOO are octal digits) - use to specify a character Escaping other characters has the effect of getting that character. Use to escape special meaning characters, like \ itself or the space. Quotes have NO special meaning so don't quote your strings. Using these sequence is expecially useful to be able to work with filenames containing spaces, or login information containing spaces. Note however that actively using ftp directories and file names containing spaces and other problematic characters (\n, \r) is very discouraged, since FTP servers are allowed to refuse to list them, or refuse to process some commands on them. If you get mysterious errors, check your filename for exotic characters. Here is an example netrc which contains some of those escape sequences: machine somewhere.myhost.com login the\ spaced\ user password \x64eadly\040habit machine anotherhost.hisnet.org login with\\backslash password \tcrazy_tabs_in_pass\t default login anon\ymous password guest Again, see netrc man page to get the full netrc file format description. Note that 'account' and 'macdef' are currently NOT supported. SIGNALS
EXIT STATUScmdftp exits with 0 on clean quit (quit command) or after displaying requested information through -h and -v options, but only when all output has been successfully written to stdout. If a failure on stdout is detected, -1 is returned instead.In all other cases (fatal errors), exit status is > 0. LIMITATIONScmdftp has a very simplified readline replacement: there is no history and little support for cmdline editing.It is very easy to force cmdftp in an infinite loop by wrong use of cp command (infinitely copying one directory into itself). There is no loop detection currently so beware. cmdftp uses passive mode FTP only by choice. cmdftp has no special proxy support. You can use real FTP proxies with cmdftp. See ftp.proxy for example. BUGSPlease report any bugs you might find, using the trackers at savannah or sending email directly to the AUTHOR.AUTHORClaudio Fontana <claudio@gnu.org>HOME PAGEhttp://savannah.nongnu.org/projects/cmdftphttp://www.nongnu.org/cmdftp FILES~/.netrc - autologin fileSEE ALSOftp(1), ftpd(8), netrc, RFC 959
Visit the GSP FreeBSD Man Page Interface. |