home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 4 / CDPD_IV.bin / networking / tcpip / amitcp-support / ncftp-1.5.6 / src / rcs / ncftp.1,v < prev    next >
Encoding:
Text File  |  1994-06-29  |  32.8 KB  |  1,405 lines

  1. head    1.1;
  2. access;
  3. symbols
  4.     ORIGINAL:1.1;
  5. locks
  6.     alph:1.1; strict;
  7. comment    @# @;
  8.  
  9.  
  10. 1.1
  11. date    93.10.02.10.34.34;    author alph;    state Exp;
  12. branches;
  13. next    ;
  14.  
  15.  
  16. desc
  17. @Original version
  18. @
  19.  
  20.  
  21. 1.1
  22. log
  23. @Initial revision
  24. @
  25. text
  26. @.\"-------
  27. .\" Man page portability notes
  28. .\"
  29. .\" These are some notes on conventions to maintain for greatest
  30. .\" portability of this man page to various other versions of
  31. .\" nroff.
  32. .\"
  33. .\" When you want a \ to appear in the output, use \e in the man page.
  34. .\" (NOTE this comes up in the rc grammar, where to print out '\n' the
  35. .\" man page must contain '\en'.)
  36. .\"
  37. .\" Evidently not all versions of nroff allow the omission of the
  38. .\" terminal " on a macro argument.  Thus what could be written
  39. .\"
  40. .\" .Cr "exec >[2] err.out
  41. .\"
  42. .\" in true nroffs must be written
  43. .\"
  44. .\" .Cr "exec >[2] err.out"
  45. .\"
  46. .\" instead.
  47. .\"
  48. .\" Use symbolic font names (e.g. R, I, B) instead of the standard
  49. .\" font positions 1, 2, 3.  Note that for Xf to work the standard
  50. .\" font names must be single characters.
  51. .\"
  52. .\" Note that sentences should end at the end of a line.  nroff and
  53. .\" troff will supply the correct intersentence spacing, but only if
  54. .\" the sentences end at the end of a line.  Explicit spaces, if given,
  55. .\" are apparently honored and the normal intersentence spacing is
  56. .\" supressed.
  57. .\"
  58. .\" DaviD W. Sanderson
  59. .\"-------
  60. .\" Dd    distance to space vertically before a "display"
  61. .\" These are what n/troff use for interparagraph distance
  62. .\"-------
  63. .if t .nr Dd .4v
  64. .if n .nr Dd 1v
  65. .\"-------
  66. .\" Sp    space down the interparagraph distance
  67. .\"-------
  68. .de Sp
  69. .sp \\n(Ddu
  70. ..
  71. .\"-------
  72. .\" Ds    begin a display, indented .5 inches from the surrounding text.
  73. .\"
  74. .\" Note that uses of Ds and De may NOT be nested.
  75. .\"-------
  76. .de Ds
  77. .Sp
  78. .in +0.5i
  79. .nf
  80. ..
  81. .\"-------
  82. .\" De    end a display (no trailing vertical spacing)
  83. .\"-------
  84. .de De
  85. .fi
  86. .in
  87. ..
  88. .TH NcFTP 1 "" NCEMRSoft
  89. .\"-------
  90. .SH "NAME"
  91. .\"-------
  92. NcFTP \(em Internet file transfer program
  93. .\"-------
  94. .SH "SYNOPSIS"
  95. .\"-------
  96. .B ncftp
  97. .RI [ "program options" ]
  98. .RI [[ "open options" ]
  99. .IR hostname [\c
  100. .B :\c
  101. .IR pathname ]]
  102. .\"-------
  103. .SH "DESCRIPTION"
  104. .\"-------
  105. .I NcFTP
  106. is a user interface to the Internet standard
  107. .IR "File Transfer Protocol" .
  108. This program allows a user to transfer files to and from a remote network
  109. site, and offers additional features that are not found in the standard
  110. interface,
  111. .IR ftp .
  112. .\"-------
  113. .SH "FEATURES"
  114. .\"-------
  115. Program options will be explained later in this document.
  116. Let's get down to business and go over the features
  117. that make this program worthwhile.
  118. .PP
  119. Here is the list of section headers; I have my $MANPAGER environment
  120. variable set to use
  121. .RB `` "less \-i" ''
  122. so that I can skip to the section I
  123. want (otherwise,
  124. .BI / regex
  125. commands to the pager won't match the section
  126. headers because of the formatting codes;
  127. the
  128. .RB `` \-i ''
  129. can search through the formatting codes)
  130. .Ds
  131. Establishing the remote connection
  132. Format of the RC file
  133. The Recent-sites file
  134. Redialing a busy remote site
  135. Supplying a sitename from your shell's command line
  136. Using Colon-mode
  137. Using FTP-cat and FTP-more mode
  138. Supplying a port number with the open command
  139. Displaying and changing program variables
  140. Program variables
  141. Listing a remote directory
  142. Viewing a remote directory with your pager
  143. Redisplaying the last directory listing
  144. Fetching files from the remote host
  145. Viewing a remote file with your pager
  146. Creating a message file on the remote host
  147. Looking up site names and addresses
  148. Checking the configuration of the program
  149. Using the command shell
  150. Customizing the prompt
  151. Keeping a log of your file transfers
  152. Program options
  153. A sample RC file
  154. .De
  155. .\"-------
  156. .SH "Establishing the remote connection"
  157. .\"-------
  158. Just opening a connection to a remote server was inconvenient enough in the
  159. stock
  160. .I ftp
  161. program to justify writing this program.
  162. Here at
  163. .IR NCEMRSoft ,
  164. we want to do our business as quickly and painlessly as possible.
  165. We'd
  166. rather save time and wear and tear on our metacarpals than bother typing
  167. entire site names, usernames, and email addresses masquerading as passwords,
  168. and setting binary mode.
  169. .PP
  170. We made all connections anonymous by default, and we automatically send our
  171. email address for the password on those connections.
  172. We allowed for site
  173. names to be abbreviated.
  174. .PP
  175. For each commonly accessed site, you can put an entry in your program
  176. preferences file (let's call it the ``ncftprc file'' or ``RC file'' for short).
  177. To open the site, from the command shell all you do is type:
  178. .Ds
  179. open wuarchive.wustl.edu
  180. .De
  181. .PP
  182. or
  183. .Ds
  184. o wuarchive.wustl.edu
  185. .De
  186. .PP
  187. As promised, you can abbreviate that further.
  188. Just use any abbreviation that
  189. would match only the site you had in mind.
  190. For the previous example, you
  191. could try:
  192. .Ds
  193. o wuarc
  194. o wustl
  195. o stl
  196. o wu
  197. .De
  198. .PP
  199. Any of those abbreviations would open wuarchive.wustl.edu anonymously,
  200. sending your anon-password (usually set to your email address) as the
  201. password.
  202. Keep in mind that the program tries opening the first site
  203. that matches the abbreviation you supplied.
  204. So:
  205. .Ds
  206. o w
  207. .De
  208. .PP
  209. might match a site named bowser.nintendo.jp if that site appeared before
  210. your entry for wuarchive.wustl.edu.
  211. .PP
  212. Most of the time we open remote sites anonymously, but
  213. there are times where you need to specifically open a site with an actual
  214. username and password.
  215. Let's say my partner, Phil Dietz, wants to FTP
  216. something out of my account.
  217. Perhaps he wants to fetch the latest version
  218. of the source code to
  219. .I NcFTP
  220. so he can optimize something or add a new feature behind my back.
  221. Since the
  222. program opens remote sites anonymously by default (actually, you can change
  223. this behavior; more on that later), he would have to specify a flag to the
  224. .I open
  225. command so he can supply my username and password.
  226. He would try:
  227. .Ds
  228. o \-u sphygmomanometer.unl.edu
  229. .De
  230. .PP
  231. or, more likely:
  232. .Ds
  233. o \-u sph
  234. .De
  235. .PP
  236. Then the program would prompt him for a username (login, whatever) and a
  237. password:
  238. .Ds
  239. Login Name (pdietz): mgleason
  240. Password: ********
  241. .De
  242. .PP
  243. If he got it right, he could raid my stuff.
  244. If not, he'd probably drop
  245. me an email asking me to quit changing my password so often.
  246. .PP
  247. There are even times where you want to FTP from your own account, like if
  248. you are debugging an FTP client you wrote.
  249. At this prompt:
  250. .Ds
  251. Login Name (mgleason):
  252. .De
  253. .PP
  254. I could just hit return to tell the program that I want ``mgleason'' as my
  255. username, then I would enter my password.
  256. .\"-------
  257. .SH "Format of the RC file"
  258. .\"-------
  259. This release of the program is somewhat compatible with the stock
  260. .I ftp
  261. program's
  262. .B ".netrc"
  263. file.
  264. However, I can promise you that in the near future the program will
  265. use a new format, so don't invest too much time in it.
  266. .PP
  267. The RC file can be named
  268. .RB `` ncftprc '',
  269. .RB `` netrc '',
  270. or
  271. .RB `` .ncftprc '',
  272. but it is usually named
  273. .RB `` .netrc ''
  274. so it can be used with the stock
  275. .I ftp
  276. program.
  277. .I NcFTP
  278. looks in the current working directory for any of those files, and then in
  279. your home directory, and after that it gives up (which is OK, because RC
  280. files aren't mandatory).
  281. .PP
  282. The file usually starts with
  283. .I #set
  284. and
  285. .I #unset
  286. commands that do things
  287. to the programs variables.
  288. The reason for the ``#'' is so the stock
  289. .I ftp
  290. program will think they are comments.
  291. You might have this appearing as
  292. the first few lines in your RC file (I'll explain later):
  293. .Ds
  294. #set debug 1
  295. #set pager "less \-EMi"
  296. #unset startup\-msg
  297. .De
  298. .PP
  299. After those, you put in machine entries for each of your favorite sites.
  300. Let's put in an entry for wuarchive.wustl.edu.
  301. First you would put:
  302. .Ds
  303. machine wuarchive.wustl.edu
  304. .De
  305. .PP
  306. Then you could put in your username, password, and account if you like:
  307. .Ds
  308. user anonymous
  309. password \-mgleason@@cse.unl.edu
  310. account wuarc.does.not.use.accounts
  311. .De
  312. .PP
  313. Following that, you would add the startup macro that is run
  314. each time you connect to wuarchive.
  315. You must start it with this line:
  316. .Ds
  317. macdef init
  318. .De
  319. .PP
  320. Then put in the commands you want to do:
  321. .Ds
  322. cd /graphics/gif
  323. ls \-lt
  324. .De
  325. .PP
  326. After that, you end the macro with a blank line (important!).
  327. The finished machine entry would look like the following.
  328. To make the transition to the impending new format less painful,
  329. I recommend you adhere to this format:
  330. .ta 6m +6m
  331. .Ds
  332. machine wuarchive.wustl.edu
  333.     user anonymous
  334.     password \-mgleason@@cse.unl.edu
  335.     account wuarc.does.not.use.accounts
  336.     macdef init
  337.         cd /graphics/gif
  338.         ls \-lt
  339. .RI \t( "mandatory blank line to end the macro" )
  340. .De
  341. .PP
  342. Of course, if all you want to do is open wuarchive anonymously, you
  343. needn't bother with the ``user'', ``password'', and ``account'' lines.
  344. You may want to put them in if you plan on using the stock
  345. .I ftp
  346. program, though.
  347. Try something like this:
  348. .ta 6m +6m
  349. .Ds
  350. machine wuarchive.wustl.edu
  351.     macdef init
  352.         cd /graphics/gif
  353.         ls \-lt
  354. .RI \t( "mandatory blank line to end the macro" )
  355. .De
  356. .PP
  357. You can tell the program to not run the startup macro if you supply
  358. .B "\-i"
  359. to the
  360. .I open
  361. command.
  362. .PP
  363. Really, you should only bother adding entries for sites that you want to
  364. run startup macros upon connection.
  365. The next section explains why.
  366. .\"-------
  367. .SH "The Recent-sites file"
  368. .\"-------
  369. Each time you open a site, the program saves the name of the site and the
  370. last directory you were in to the
  371. .I recent-sites file
  372. which is named
  373. .B ".ncrecent"
  374. and placed in your home directory.
  375. The program saves a
  376. predetermined number of these sites in the file, and when it reaches the
  377. limit, it discards the oldest entry so it can add a new one.
  378. .PP
  379. You can just go ahead and use the name of the site you want with the
  380. .I open
  381. command if you know it is in the
  382. .I recent\-file
  383. (and you can abbreviate the
  384. name, just like those in the RC file).
  385. But if you cannot remember what the
  386. name of the site you want, all you do is run the
  387. .I open
  388. command with
  389. no site parameter:
  390. .Ds
  391. open
  392. .De
  393. .PP
  394. This will pop up a list of the sites in the
  395. .IR "recent-file" ,
  396. and sites in your RC file.
  397. At the open prompt, just type the name (or an
  398. abbreviation of that name) or the number preceding the site name to open
  399. that site.
  400. After opening the site you wanted, the program sets the remote
  401. working directory to the same one you left in the last time you called.
  402. .PP
  403. If you don't like the idea of having the sites you called stored on disk,
  404. you can turn this feature off using an
  405. .I unset
  406. command, explained later.
  407. .\"-------
  408. .SH "Redialing a busy remote site"
  409. .\"-------
  410. Some remote sites limit the number of leeches, er, anonymous connections
  411. at a time to reduce the load on the host computer.
  412. You can use the
  413. .I open
  414. command's redial feature to keep attempting connections until you get on,
  415. although that is not a very polite thing to do.
  416. The simplest way to do
  417. this would be to just supply the
  418. .B \-r
  419. option:
  420. .Ds
  421. open \-r wuarc
  422. .De
  423. .PP
  424. There are also options you can use to tweak redial.
  425. The
  426. .B \-d
  427. flag sets
  428. the delay between dials, and the
  429. .B \-g
  430. flag sets a limit on how many dials
  431. should be attempting before giving up.
  432. If you don't supply
  433. .B \-g
  434. the program will dial a day and forever (which my Number Theory professor,
  435. Dr. Mientka, says is longer than forever and a day)
  436. until it connects successfully, or until you get sick of waiting and hit the
  437. interrupt key (usually ^C).
  438. .PP
  439. This example dials wuarchive every ten minutes, giving up after twenty
  440. attempts.
  441. Note that the redial delay is specified in seconds:
  442. .Ds
  443. open \-r \-d 600 \-g 20 wuarc
  444. .De
  445. .PP
  446. Please be considerate when you use redialing, so you won't tax the network.
  447. Site administrators can and do get angry when they get flooded with
  448. connections.
  449. .\"-------
  450. .SH "Supplying a sitename from your shell's command line"
  451. .\"-------
  452. When you run the program:
  453. .Ds
  454. ncftp
  455. .De
  456. .PP
  457. by itself does nothing and waits for you to type commands to the program's
  458. own shell.
  459. Just like the stock
  460. .I ftp
  461. program, you can supply a site name
  462. on the command line:
  463. .Ds
  464. ncftp wuarchive.wustl.edu
  465. .De
  466. .PP
  467. You can also use abbreviations as usual:
  468. .Ds
  469. ncftp wuarc
  470. .De
  471. .PP
  472. This is equivalent to running the program, then issuing an
  473. .I open
  474. command to open wuarchive.
  475. .\"-------
  476. .SH "Using Colon-mode"
  477. .\"-------
  478. The
  479. .I open
  480. command is not a one-trick pony.
  481. Another option is what I call
  482. .IR "colon-mode" .
  483. This feature is used (most of the time) from your shell's
  484. command line.
  485. .PP
  486. In ancient times, way back during the Disco era, you could use a program
  487. called
  488. .I tftp
  489. to fetch a file using the Internet standard
  490. .I Trivial File Transfer Protocol.
  491. You could use that program to do something like this
  492. from within its shell:
  493. .Ds
  494. get wuarchive.wustl.edu:/graphics/gif/README
  495. .De
  496. .PP
  497. and that would call wuarchive and fetch the
  498. .B README
  499. file.
  500. .PP
  501. You can use this program to do the same thing from your shell's command
  502. line:
  503. .Ds
  504. csh> ncftp wuarchive.wustl.edu:/graphics/gif/README
  505. csh> head README
  506. .De
  507. .PP
  508. This tells your shell, in this case the ``c-shell'' to run
  509. .IR NcFTP ,
  510. which
  511. would open wuarchive, fetch
  512. .B /graphics/gif/README
  513. and write the file
  514. .B ./README
  515. in the current working directory, and then exits.
  516. This is nice if you don't
  517. want to browse around the remote site, and you know exactly want you want.
  518. It would also come in handy in shell scripts, where you don't want to
  519. enter the command shell, and might not want the program to spew output.
  520. .PP
  521. You can use
  522. .I colon-mode
  523. to set the starting remote working directory also:
  524. .Ds
  525. csh> ncftp wuarchive.wustl.edu:/graphics/gif
  526. .De
  527. .PP
  528. This would run the program, open wuarchive, and
  529. .I cd
  530. to the gif directory, then run the program's command shell so you can
  531. browse.
  532. .PP
  533. .I Colon-mode
  534. is also available from within the program's command shell.
  535. At a prompt you can do stuff like this:
  536. .Ds
  537. ncftp> open wuarchive.wustl.edu:/graphics/gif/README
  538. ncftp> o wuarc:/graphics/gif
  539. .De
  540. .\"-------
  541. .SH "Using FTP-cat and FTP-more mode"
  542. .\"-------
  543. There are times where you might not want the program to write a
  544. .I colon-mode
  545. file in the current working directory, or perhaps you want to pipe the
  546. output of a remote file into something else.
  547. .I Colon-mode
  548. has options to
  549. do this.
  550. It was inspired by the guy who wrote the
  551. .I ftpcat
  552. perl script.
  553. The
  554. .B \-c
  555. option tells the program to write on the standard
  556. output stream.
  557. The
  558. .B \-m
  559. option pipes the file into your pager (like
  560. .IR more ")"
  561. Of course this won't work if the thing you give
  562. .I colon-mode
  563. is a directory!  This example just dumps a remote file to stdout:
  564. .Ds
  565. csh> ncftp \-c wuarc:/graphics/gif/README
  566. \&...
  567. csh>
  568. .De
  569. .PP
  570. This example redirects a remote file into a different
  571. location:
  572. .Ds
  573. csh> ncftp \-c wu:/README > ~pdietz/thesis.tex
  574. .De
  575. .PP
  576. This one shows how to use a pipeline:
  577. .Ds
  578. csh> ncftp \-c wuarc:/README | tail | wc \-l
  579. 10
  580. csh>
  581. .De
  582. .PP
  583. This shows how to page a remote file:
  584. .Ds
  585. csh> ncftp \-m wuarc:/graphics/gif/README
  586. \&...
  587. csh>
  588. .De
  589. .\"-------
  590. .SH "Supplying a port number with the open command"
  591. .\"-------
  592. This option just didn't fit anywhere else, so to finish out the open command,
  593. .B \-p
  594. lets you supply a port number if you have to
  595. .I ftp
  596. to a site using an nonstandard port number.
  597. Personally, I have yet to use feature, but its
  598. there for compatibility with the stock
  599. .I ftp
  600. program.
  601. .\"-------
  602. .SH "Displaying and changing program variables"
  603. .\"-------
  604. Now I'll explain the commands unique to
  605. .IR NcFTP .
  606. The others should perform the
  607. same as they would in the stock
  608. .I ftp
  609. program;
  610. consult the man page for it if you want those explained,
  611. or use the
  612. .I help
  613. command for a brief blurb.
  614. .PP
  615. The
  616. .I show
  617. command is used to display program variables and their values.
  618. .Ds
  619. show all
  620. .De
  621. .PP
  622. or
  623. .Ds
  624. show
  625. .De
  626. .PP
  627. would display all the variables with their values.
  628. .Ds
  629. .RI show " var1 var2 ... varN"
  630. .De
  631. .PP
  632. would display each specified variable and its value.
  633. .PP
  634. The
  635. .I set
  636. command changes the value of a program variable.
  637. Its syntax is:
  638. .Ds
  639. .RI set " varname value"
  640. .De
  641. .PP
  642. For Boolean or Integer variables,
  643. .Ds
  644. .RI set " varname"
  645. .De
  646. .PP
  647. would set the value of the variable
  648. .I varname
  649. to
  650. .B 1
  651. .RB ( true ).
  652. .PP
  653. The
  654. .I unset
  655. command can be used to set the variable to its default value,
  656. or for Boolean and Integer variables, set the value of the variable to
  657. .B 0
  658. .RB ( false ).
  659. For String variables, you can use this to set the value to an
  660. empty string.
  661. .PP
  662. You can use any of those three commands in both the command shell,
  663. or in the RC file with a ``#'' prepended.
  664. .\"-------
  665. .SH "Program variables"
  666. .\"-------
  667. Each variable can be one of the following types:
  668. .TP
  669. Boolean:
  670. Can be
  671. .RB `` on ''
  672. or
  673. .RB `` off ''
  674. (you can also use
  675. .RB `` 1 ''
  676. or
  677. .RB `` 0 '').
  678. .TP
  679. Integer:
  680. Can be any positive or negative number, or
  681. .BR 0 .
  682. .TP
  683. String:
  684. Is a string of characters.
  685. If the string needs to have a space
  686. in it, make sure you surround the whole string with double quotes in a
  687. .I set
  688. command.
  689. .PP
  690. Variables follow.
  691. Some variables are explained later in the relevant sections.
  692. .TP
  693. .IR anon\-open " (Boolean)"
  694. Tells whether the default login mode is anonymous if
  695. on, or if off, will prompt for a username/password.
  696. You can always override this by using either
  697. .B \-a
  698. or
  699. .B \-u
  700. with the
  701. .I open
  702. command.
  703. .TP
  704. .IR anon\-password " (String)"
  705. Sends this as the password when you login anonymously.
  706. By default this is your email address.
  707. .TP
  708. .IR ansi\-escapes " (Boolean)"
  709. If on, the program can use boldface, underline,
  710. and inverse text.
  711. .TP
  712. .IR auto\-binary " (Boolean)"
  713. If on, sets the transfer type to binary mode
  714. immediately after connection.
  715. .TP
  716. .IR debug " (Integer)"
  717. Sets the debugging level.
  718. .TP
  719. .IR gateway\-login " (String)"
  720. Tells which username to use when logging in to
  721. your firewall gateway host.
  722. .TP
  723. .IR gateway\-host " (String)"
  724. The site which is acting as your firewall gateway,
  725. or empty if you aren't using one.
  726. .TP
  727. .IR local\-dir " (String)"
  728. The current local working directory.
  729. I like to set this from my RC file,
  730. so all my files go into my download directory.
  731. .TP
  732. .IR logfile " (String)"
  733. The name of your personal transfer log, or empty
  734. if you aren't using a transfer log.
  735. .TP
  736. .IR logsize " (Integer)"
  737. The maximum ceiling of your log file, before the program
  738. removes old entries.
  739. .TP
  740. .IR mprompt " (Boolean)"
  741. If on, prompts for each remote file expanded from a
  742. wildcard globbing expression.
  743. .TP
  744. .IR netrc " (String, Read-only)"
  745. Tells you the name of the RC file in use.
  746. .TP
  747. .IR pager " (String)"
  748. The pathname and flags of the program used to display
  749. output one screenful at a time.
  750. The default is the value of your $PAGER
  751. environment variable.
  752. .TP
  753. .IR prompt " (String)"
  754. The prompt specification that expands into the prompt.
  755. .TP
  756. .IR progress\-reports " (Integer)"
  757. Which progress meter to use, or 0 if you
  758. don't want progress reports during file transfers.
  759. .TP
  760. .IR recent\-list " (Boolean)"
  761. If on, uses and updates the
  762. .I recent\-file.
  763. .TP
  764. .IR remote\-is\-unix " (Boolean)"
  765. Set automatically by the program upon connection,
  766. you may need to use this in a startup macro if the program guessed
  767. that a remote site was UNIX when it really is not.
  768. .TP
  769. .IR startup\-msg " (Boolean)"
  770. If on, prints the opening message and tip.
  771. .TP
  772. .IR tips " (Boolean)"
  773. If on, prints a tip on how to use the program better each
  774. time you run the program.
  775. .TP
  776. .IR type " (String)"
  777. The name of the file transfer mode in use,
  778. such as
  779. .RB `` binary ''
  780. or
  781. .RB `` ascii ''.
  782. .TP
  783. .IR verbose " (String/Integer)"
  784. Controls the amount of output spewed by the program.
  785. You can supply either the first character of the name of the
  786. verbosity level, or its number:
  787. .RS
  788. .TP
  789. .IR "Q" "uiet (\-1)"
  790. Won't print any output at all, even if an error occurs.
  791. .TP
  792. .IR "E" "rrors Only (0)"
  793. No output, except when errors occur.
  794. .TP
  795. .IR "T" "erse (1)"
  796. Prints errors, and useful output from the remote host.
  797. .TP
  798. .IR "V" "erbose (2)"
  799. Prints everything, even junk output from the remote end.
  800. .RE
  801. .\"-------
  802. .SH "Listing a remote directory"
  803. .\"-------
  804. The
  805. .I ls
  806. and
  807. .I dir
  808. commands perform in a similar manner to those of the
  809. stock
  810. .I ftp
  811. program.
  812. .PP
  813. The
  814. .I ls
  815. command sends the FTP command ``NLST'' for you.
  816. This command has been set so that it defaults
  817. to always listing files in columns (this is the
  818. .B \-C
  819. option given to the UNIX
  820. .I ls
  821. command) and appending
  822. metacharacters to each item name (this is the
  823. .B \-F
  824. option), so you can
  825. see which items are directories, files, links, etcetera.
  826. If you don't want
  827. your items columnized, you can try using the
  828. .B \-1
  829. option with
  830. .I ls
  831. to print one item per line.
  832. .PP
  833. The
  834. .I dir
  835. command sends the FTP command ``LIST'' for you, which instead
  836. of printing just item names, it prints item sizes, owners, dates, and
  837. permissions as well.
  838. This command is equivalent to
  839. .RB `` "ls \-l" ''
  840. on most remote systems.
  841. .PP
  842. The usage for both commands is the same.
  843. Here is the one for
  844. .IR ls :
  845. .PP
  846. .RS
  847. .B ls
  848. .RI [ \-flags ]
  849. .RI [ "directory and file names" ]
  850. .RI [ redirection ]
  851. .RE
  852. .PP
  853. Note that in this program, you can supply both flags and items to list in
  854. the same command.
  855. The stock version of
  856. .I ftp
  857. doesn't let you do this:
  858. .Ds
  859. ls \-lrt /info\-mac/help
  860. .De
  861. .PP
  862. Another thing that the program does which the others should have done is
  863. let you supply more than one item:
  864. .Ds
  865. ls \-lrt /info\-mac/help /pub /info\-mac/README
  866. .De
  867. .PP
  868. You can also redirect the output into a file, or pipe it into something.
  869. This example shows how to list the contents of the current remote directory,
  870. and save the output into a file in the current local directory:
  871. .Ds
  872. ls \-t >ls.out
  873. .De
  874. .PP
  875. Note that for this to work, there must be no whitespace between the ``>''
  876. and the filename, unlike your shell command line which allows for extra
  877. whitespace.
  878. This will be (actually, is) fixed in a future version of the
  879. program.
  880. .PP
  881. These examples show how to use a pipe:
  882. .Ds
  883. ls \-t |tail
  884. dir \-t "|less \-CM"
  885. ls \-t "|tail | wc"
  886. .De
  887. .PP
  888. Like the redirection example, there must be no whitespace between the first
  889. pipe character and the rest of the stuff.
  890. The trick is that it has to
  891. appear as one argument to the commands.
  892. The second and third examples
  893. illustrate the use of double quotes to squeeze extra parameters in.
  894. The second example can be done without all that typing.
  895. See the descriptions of the
  896. .I pdir
  897. and
  898. .I pls
  899. commands below.
  900. .\"-------
  901. .SH "Viewing a remote directory with your pager"
  902. .\"-------
  903. Didn't you hate it when you listed a remote directory, only to have most of
  904. the stuff scrolled off your terminal before you could read it?
  905. The
  906. .I pls
  907. and
  908. .I pdir
  909. commands take care of this for you.
  910. As you might have guessed,
  911. they perform exactly like their regular counterparts,
  912. only you view them with your pager.
  913. The pager to use is controlled by the
  914. .I pager
  915. program variable.
  916. .\"-------
  917. .SH "Redisplaying the last directory listing"
  918. .\"-------
  919. The program saves the listing into a local buffer,
  920. so if you need to see it again (probably forgot about
  921. .IR pdir )
  922. you can use the
  923. .I redir
  924. and
  925. .I predir
  926. commands for this.
  927. .\"-------
  928. .SH "Fetching files from the remote host"
  929. .\"-------
  930. The
  931. .I get
  932. and
  933. .I mget
  934. retrieve remote files for you.
  935. The usage for
  936. .I get
  937. is:
  938. .Ds
  939. get remote\-file [local\-file or redirection]
  940. .De
  941. .PP
  942. To fetch
  943. .B /pub/README
  944. and write it as a file named
  945. .BR ./junk/readme ,
  946. try:
  947. .Ds
  948. get /pub/README ./junk/readme
  949. .De
  950. .PP
  951. To fetch
  952. .B /pub/README
  953. and write it as
  954. .BR ./README ,
  955. just do:
  956. .Ds
  957. get /pub/README
  958. .De
  959. .PP
  960. This lets you fetch a file using its whole pathname, and write a copy of
  961. it in the current directory, without having to bother with typing a local
  962. filename.
  963. In the unlikely event that you have write permission to a
  964. directory called
  965. .B /pub
  966. on your local machine, it would write
  967. .RB `` README ''
  968. in that directory.
  969. .PP
  970. Most of the time the file you want will be in the current remote directory,
  971. so you can just do these:
  972. .Ds
  973. get README
  974. get README ./junk/readme
  975. .De
  976. .PP
  977. You can also use a redirection for
  978. .IR get ,
  979. just like you can with the
  980. .IR ls ", " dir ", and " redir
  981. commands.
  982. As described earlier, you have
  983. to conform to the format below for this release of the program:
  984. .Ds
  985. get README >/dev/null
  986. get README |head
  987. get README "|head \-8"
  988. get README "|less \-EMi"
  989. .De
  990. .PP
  991. The last example is facilitated by the
  992. .I page
  993. command described later.
  994. .PP
  995. The
  996. .I get
  997. command can also use a wildcard expression in an attempt to
  998. match exactly one remote file.
  999. I call it ``Poor Man's File Completion.''
  1000. If you've done a remote listing, and you decide you want to download a
  1001. file by the name of
  1002. .RB `` obnoxiouslylongpackagename.tar.Z '',
  1003. you can use
  1004. ``PMFC'' to save some keystrokes.
  1005. Choose an expression that will only
  1006. match that one file, then use it with
  1007. .IR get :
  1008. .Ds
  1009. get obn*.Z a.tar.Z
  1010. .De
  1011. .PP
  1012. If your pattern was unique,
  1013. .I get
  1014. will fetch that file only.
  1015. If the pattern matched more than one file, the program will bitch and moan.
  1016. .PP
  1017. The
  1018. .I mget
  1019. command is used to fetch many files at a time.
  1020. The difference between
  1021. .I get
  1022. and
  1023. .I mget
  1024. is that
  1025. .I get
  1026. lets you write only one file,
  1027. but you can put it in a different directory, while
  1028. .I mget
  1029. fetches many files,
  1030. always writing them in the current local directory.
  1031. This example fetches several remote files at once:
  1032. .Ds
  1033. mget a.file.Z b.file.Z c.tar d.tar.Z
  1034. .De
  1035. .PP
  1036. The
  1037. .I mget
  1038. command, and its ugly sisters,
  1039. .I mput
  1040. and
  1041. .I mdelete
  1042. let you use wildcard expressions.
  1043. I could have done the previous example as:
  1044. .Ds
  1045. mget *.Z c.tar
  1046. .De
  1047. .PP
  1048. instead.
  1049. The ``m'' commands will verify each file,
  1050. if you have the program variable
  1051. .I mprompt
  1052. set.
  1053. .\"-------
  1054. .SH "Viewing a remote file with your pager"
  1055. .\"-------
  1056. If you would like to read a file on the remote host without saving a copy
  1057. of it on your machine, you can use the
  1058. .I page
  1059. (or
  1060. .I more
  1061. if you wish) command:
  1062. .Ds
  1063. page README
  1064. page obn*README
  1065. page README.Z
  1066. .De
  1067. .PP
  1068. The second example show that you can use ``PMFC'' like you can for
  1069. .IR get.
  1070. The third example will work also, because if the program knows how to
  1071. decompress the file, it will do so before feeding it to your pager.
  1072. As stated earlier,
  1073. you can change the program to use to page by setting the program variable
  1074. .IR pager.
  1075. .\"-------
  1076. .SH "Creating a message file on the remote host"
  1077. .\"-------
  1078. Use the
  1079. .I create
  1080. an empty file on the remote site.
  1081. Sometimes it is necessary to leave a note if you can't get in touch
  1082. with the remote site's administrator.
  1083. For example if a file is corrupted, you could try:
  1084. .Ds
  1085. create Foo.tar_is_corrupt
  1086. .De
  1087. .PP
  1088. in hopes that the original uploader will replace it.
  1089. .\"-------
  1090. .SH "Looking up site names and addresses"
  1091. .\"-------
  1092. You can use the program's builtin
  1093. .RI mini- nslookup
  1094. facility.
  1095. If you wanted to know the site's IP number, but only knew the name you
  1096. could do:
  1097. .Ds
  1098. lookup cse.unl.edu
  1099. .De
  1100. .PP
  1101. This would spit out IP number for that site, in this case ``129.93.1.12''.
  1102. If you needed to know what a site's name was, but only knew the IP number,
  1103. try:
  1104. .Ds
  1105. lookup 129.93.1.12
  1106. .De
  1107. .PP
  1108. This would spit out the name for that site, in this case ``cse.unl.edu''.
  1109. .\"-------
  1110. .SH "Checking the configuration of the program"
  1111. .\"-------
  1112. Use the
  1113. .I version
  1114. command to print version and compilation information about the program.
  1115. This will also tell you which optional features are
  1116. compiled into the program, such as logging to the system log and which
  1117. command line editor (if any) has been installed.
  1118. .PP
  1119. The author's email address is listed, and if you need to report something,
  1120. send the output of this command along with your message.
  1121. .\"-------
  1122. .SH "Using the command shell"
  1123. .\"-------
  1124. Just like the stock
  1125. .I ftp
  1126. program, you type commands to it until you get
  1127. bored and hit either ^D or type the
  1128. .I quit
  1129. command.
  1130. .PP
  1131. The program supports links to popular command line editing libraries.
  1132. If the person who compiled it went to the effort, you will be able to
  1133. edit the command line with arrow keys and other editing commands, and also
  1134. scroll up and down in the command line history, usually with the up and
  1135. down arrows.
  1136. You can check the
  1137. .I version
  1138. command to see if either
  1139. ``GETLINE'' or ``READLINE'' are installed.
  1140. .\"-------
  1141. .SH "Customizing the prompt"
  1142. .\"-------
  1143. You can set the shell's prompt string to whatever you like.
  1144. You can use several metacharacters that expand into something each prompt.
  1145. The
  1146. .RB `` % ''
  1147. flags are passed to
  1148. .IR strftime (3),
  1149. so you can put the date or time in the prompt formatted as you like it:
  1150. .Ds
  1151. set prompt "%I:%M ncftp>"
  1152. .De
  1153. .PP
  1154. That would the current time in the prompt.
  1155. .PP
  1156. The
  1157. .RB `` @@ ''
  1158. flags are expanded by the program itself.
  1159. Here's the list of them.
  1160. .PP
  1161. If you have an ANSI-compatible terminal, or you have the program variable
  1162. .I ansi\-escapes
  1163. set, you can use
  1164. .BR @@B ,
  1165. .BR @@I ,
  1166. and
  1167. .B @@U
  1168. to turn on boldface,
  1169. inverse, and underline text respectively (otherwise they won't insert
  1170. anything).
  1171. You can also use
  1172. .B @@R
  1173. to turn on inverse (reverse) text.
  1174. .B @@P
  1175. sets the text back to plain text.
  1176. .PP
  1177. .B @@D
  1178. Inserts the full path of the current remote directory.
  1179. The
  1180. .B @@J
  1181. flag is similar except it inserts only the directory name.
  1182. .PP
  1183. .B @@H
  1184. Inserts the name of the remote host.
  1185. .B @@C
  1186. inserts the host and current
  1187. directory path in
  1188. .I "colon-mode"
  1189. format, such as
  1190. ``cse.unl.edu:/pub/mgleason'', or ``(not connected)''.
  1191. The
  1192. .B @@c
  1193. flag is similar, only it will insert ``cse.unl.edu:/pub/mgleason'' and a
  1194. newline if connected, otherwise it prints nothing.
  1195. The default prompt uses
  1196. this flag to print a two line prompt when connected and a one line prompt
  1197. when not connected.
  1198. .PP
  1199. .BR @@E " or " @@!
  1200. inserts the event number (how many commands you've typed).
  1201. .PP
  1202. .B @@M
  1203. inserts ``(Mail)\0'' if mail has arrived since running the program.
  1204. .PP
  1205. .B @@N
  1206. inserts a newline character.
  1207. .\"-------
  1208. .SH "Keeping a log of your file transfers"
  1209. .\"-------
  1210. You can have the program keep a personal log file.
  1211. I find it is useful so I can see where I got a certain file,
  1212. or what the name of that site was I called two weeks ago.
  1213. .PP
  1214. To use a log, add:
  1215. .Ds
  1216. #set logfile ~/.ftplog
  1217. .De
  1218. .PP
  1219. (or whatever you want to name the log) to your RC file.
  1220. I don't want my log growing too large and using up all my disk space,
  1221. so I also have:
  1222. .Ds
  1223. #set logsize 10240
  1224. .De
  1225. .PP
  1226. in my RC file.
  1227. If you set the limit on the maximum log size, the program will
  1228. keep the log file at or below that size, discarding old entries.
  1229. .PP
  1230. Note that this is different from having SYSLOG appear in the
  1231. .I version
  1232. command's output.
  1233. When this is on, your actions are recorded to the system
  1234. log, so your system administrator can make sure you aren't doing anything
  1235. ``bad.''
  1236. .\"-------
  1237. .SH "Program options"
  1238. .\"-------
  1239. Remember that you can treat the command line like an
  1240. .I open
  1241. command,
  1242. so all lowercase options are passed to the
  1243. .I open
  1244. command, and the
  1245. uppercase options are handled by the main program.
  1246. The uppercase options
  1247. are described below; refer to the
  1248. .I open
  1249. command for descriptions of its options.
  1250. .TP
  1251. .BI \-D " x"
  1252. sets the debugging level to
  1253. .IR x .
  1254. .TP
  1255. .B \-H
  1256. runs the
  1257. .I version
  1258. command and exits, so you can save the output of
  1259. it to use when you need to mail me something.
  1260. .TP
  1261. .B \-I
  1262. toggles the mprompt variable; this is provided for compatibility with
  1263. .RB `` "ftp \-i" ''.
  1264. .TP
  1265. .B \-N
  1266. disables reading of the RC file;
  1267. this is provided for compatibility with
  1268. .RB `` "ftp \-n" ''.
  1269. .TP
  1270. .BI \-V " x"
  1271. sets verbosity to level
  1272. .I x
  1273. .RB ( \-1 ,
  1274. .BR 0 ,
  1275. .BR 1 ,
  1276. .BR 2 )
  1277. or
  1278. .RB ( quiet ,
  1279. .BR errs ,
  1280. .BR terse ,
  1281. .BR verbose ).
  1282. See the description of the
  1283. .I verbose
  1284. program variable for more information.
  1285. .PP
  1286. Here are some example command lines.
  1287. Again, see the description of the
  1288. .I open
  1289. command (especially
  1290. .IR "colon-mode" " and " "FTP\-cat mode" ")"
  1291. and all its functions for more information.
  1292. .PP
  1293. This just enters the
  1294. .I NcFTP
  1295. command shell:
  1296. .Ds
  1297. csh> ncftp
  1298. .De
  1299. .PP
  1300. This fetches
  1301. .B CONTENTS
  1302. and then quits:
  1303. .Ds
  1304. csh> ncftp cse.unl.edu:/pub/mgleason/CONTENTS
  1305. .De
  1306. .PP
  1307. Some others examples, with open options and main program options mixed in:
  1308. .Ds
  1309. csh> ncftp \-V quiet \-u ftp.unl.edu
  1310. csh> ncftp \-c cse.unl.edu:/pub/mgleason/CONTENTS
  1311. csh> ncftp \-D 2 \-r \-d 120 \-g 10 \-N ftp.unl.edu
  1312. .De
  1313. .\"-------
  1314. .SH "A sample RC file"
  1315. .\"-------
  1316. Here is a sample RC file:
  1317. .ta 6m +6m
  1318. .Ds
  1319. #set logfile ~/.ftplog
  1320. #set progress\-reports 2
  1321. #set local\-dir /usr/tmp/zz
  1322. #set prompt "@@B@@E @@UNcFTP@@P @@B@@M@@D@@P \->"
  1323. .sp
  1324. machine sumex\-aim.stanford.edu
  1325.     macdef init
  1326.         cd /info\-mac
  1327.         get ./help/recent\-files.txt "|grep \-v '.abs' > sumex
  1328.         !less sumex
  1329.         pwd
  1330. .sp
  1331. # This site is in here just so I can use ``apple''
  1332. # as an abbreviation.
  1333. machine ftp.apple.com
  1334. .sp
  1335. # NcFTP will only ask for your password:
  1336. machine cse.unl.edu
  1337.     login mgleason
  1338. .sp
  1339. # You can supply a login and a password:
  1340. machine fake.machine.unl.edu
  1341.     login mgleason
  1342.     password mypass
  1343.     macdef init
  1344.     cd ./foo/bar
  1345. .sp
  1346. # If an antiquated non-UNIX machine doesn't use
  1347. # the "SYST" command, you may need to unset
  1348. # remote\-is\-unix, if the remote host complains
  1349. # about ``ls \-CF''.
  1350. machine some.vms.unl.edu
  1351.     macdef init
  1352.     unset remote\-is\-unix
  1353. .sp
  1354. .De
  1355. .\"-------
  1356. .SH "AUTHORS"
  1357. .\"-------
  1358. .I NcFTP
  1359. was written by Mike Gleason,
  1360. .I NCEMRSoft
  1361. (mgleason@@cse.unl.edu), and based on code by the authors of the
  1362. .I ftp
  1363. from the BSD 4.3 distribution.
  1364. .I NcFTP
  1365. is copyrighted 1992, 1993 by NCEMRSoft
  1366. and 1985, 1989 by the Regents of California.
  1367. .PP
  1368. Ideas and some code contributed by Phil Dietz,
  1369. .I NCEMRSoft
  1370. (pdietz@@cse.unl.edu).
  1371. Testing and debugging done by Phil and
  1372. Kok Hon Yin (hkok@@cse.unl.edu).
  1373. .PP
  1374. Extensive man page formatting work
  1375. by DaviD W. Sanderson (dws@@ssec.wisc.edu).
  1376. .\"-------
  1377. .SH "BUGS"
  1378. .\"-------
  1379. Correct execution of many commands depends upon proper behavior
  1380. by the remote server.
  1381. .PP
  1382. The remote server may drop the connection if you take a long time to
  1383. page remote files.
  1384. .PP
  1385. Termcap padding is not correctly displayed.
  1386. .PP
  1387. There are no such sites named
  1388. .I bowser.nintendo.jp
  1389. or
  1390. .IR sphygmomanometer.unl.edu .
  1391. .\"-------
  1392. .SH "SEE ALSO"
  1393. .\"-------
  1394. .IR strftime (3),
  1395. .IR ftpd (8),
  1396. .IR ftp (1),
  1397. .IR nslookup (1),
  1398. .IR compress (1),
  1399. .IR gzip (1),
  1400. .IR zcat (1),
  1401. .IR fsp (1),
  1402. .IR archie (1),
  1403. .IR tftp (1).
  1404. @
  1405.