1<HTML> 2<HEAD> 3<TITLE>ncftp(1) manual page</TITLE> 4</HEAD> 5<BODY bgcolor=white> 6<p align="right"> 7<A HREF="#toc">Table of Contents</A><P> 8 9<H2><A NAME="sect0" HREF="#toc0">Name</A></H2> 10<UL> 11 <b>NcFTP</b> - Browser 12program for the File Transfer Protocol 13</UL> 14<H2><A NAME="sect1" HREF="#toc1">Synopsis</A></H2> 15<UL> 16<P> 17<B>ncftp</B> [<I>host</I>]<I></I> <P> 18<B>ncftp</B> [<I>ftp://host.name/directory/</I>] 19 20</UL> 21 22<H2><A NAME="sect2" HREF="#toc2">Description</A></H2> 23 <P> 24The purpose of <I>ncftp</I> is to provide a powerful and flexible 25interface to the Internet standard <I>File Transfer Protocol</I>. It is intended 26to replace the stock <I>ftp</I> program that comes with the system. <P> 27Although the 28program appears to be rather spartan, you'll find that <I>ncftp</I> has a wealth 29of valuable performance and usage features. The program was designed with 30an emphasis on usability, and it does as much as it can for you automatically 31so you can do what you expect to do with a file transfer program, which 32is transfer files between two interconnected systems. <P> 33Some of the cooler 34features include progress meters, filename completion, command-line editing, 35background processing, auto-resume downloads, bookmarking, cached directory 36listings, host redialing, working with firewalls and proxies, downloading 37entire directory trees, etc., etc. <P> 38The <I>ncftp</I> distribution comes with the 39useful utility programs <I><I>ncftpget</I>(1)</I> and <I><I>ncftpput</I>(1)</I> which were designed 40to do command-line FTP. In particular, they are very handy for shell scripts. 41This version of <I>ncftp</I> no longer does command-line FTP, since the main <I>ncftp</I> 42program is more of a browser-type program.</P> 43 44<center> 45<p> 46<form action="https://www.paypal.com/cgi-bin/webscr" method="post"> 47<input type="hidden" name="cmd" value="_xclick"> 48<input type="hidden" name="business" value="sales@ncftp.com"> 49<input type="hidden" name="item_name" value="NcFTP Client"> 50<input type="hidden" name="item_number" value="NcFTP"> 51<input type="hidden" name="no_shipping" value="2"> 52<input type="hidden" name="no_note" value="1"> 53<input type="hidden" name="currency_code" value="USD"> 54<input type="hidden" name="tax" value="0"> 55<input type="hidden" name="bn" value="PP-DonationsBF"> 56<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-butcc-donate.gif" border="0" name="submit" alt="Make a donation!"> 57<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> 58</form> 59</center> 60 61 62<H3><A NAME="sect2a" HREF="#toc2a">Options</A></H3> 63<P> 64The program allows you to specify a host or directory URL 65on the command line. This is a synonym for running ncftp 66and then using the open command. A few command-line flags 67are allowed with this mode: 68<UL> 69<table width=100%> 70 <tr> 71 <td width=50><B>-u</B> <I>XX</I></td> 72 <td>Use username <I>XX</I> instead of anonymous.</td> 73 </tr> 74 <tr> 75 <td width=50><B>-p</B> <I>XX</I></td> 76 <td>Use password <I>XX</I> with the username.</td> 77 </tr> 78 <tr> 79 <td width=50><B>-j</B> <I>XX</I></td> 80 <td>Use account <I>XX</I> in supplement to the username and password (deprecated)</td> 81 </tr> 82 <tr> 83 <td width=50><B>-P</B> <I>XX</I></td> 84 <td>Use port number <I>XX</I> instead of the default FTP service port (21).</td> 85 </tr> 86</table> 87</UL> 88</P> 89 90<H3><A NAME="sect3" HREF="#toc3">Introduction to the Command Shell</A></H3> 91 92<P> 93Upon running the program you are presented a command prompt where you type 94commands to the program's shell. Usually you will want to open a remote filesystem 95to transfer files to and from your local machine's filesystem. To do that, 96you need to know the symbolic name of the remote system, or its <I>Internet 97Protocol</I> (IP) address. For example, a symbolic name might be ``typhoon.unl.edu,'' 98and its IP address could be ``129.93.33.24.'' To open a connection to that system, 99you use the program's <I>open</I> command: 100<UL> 101<PRE>open typhoon.unl.edu 102open 129.93.33.24</PRE> 103</UL> 104 <P> 105Both of these try to open the machine called typhoon at the <I>University 106of Nebraska</I>. Using the symbolic name is the preferred way, because IP addresses 107may change without notice, while the symbolic names usually stay the same. 108<P> 109When you open a remote filesystem, you need to have permission. The <I>FTP 110Protocol</I>'s authentication system is very similar to that of logging in to 111your account. You have to give an account name, and its password for access 112to that account's files. However, most remote systems that have anything 113you might be interested in don't require an account name for use. You can 114often get anonymous access to a remote filesystem and exchange files that 115have been made publicly accessible. The program attempts to get anonymous 116permission to a remote system by default. What actually happens is that 117the program tries to use ``anonymous'' as the account name, and when prompted 118for a password, uses your E-mail address as a courtesy to the remote system's 119maintainer. You can have the program try to use a specific account also. 120That will be explained later. <P> 121After the <I>open</I> command completes successfully, 122you are connected to the remote system and logged in. You should now see 123the command prompt change to reflect the name of the current remote directory. 124To see what's in the current remote directory, you can use the program's 125<I>ls</I> and <I>dir</I> commands. The former is terse, preferring more remote files 126in less screen space, and the latter is more verbose, giving detailed information 127about each item in the directory. <P> 128You can use the program's <I>cd</I> command to 129move to other directories on the remote system. The cd command behaves very 130much like the command of the same name in the <I>Bourne</I> and <I>Korn</I> shell. <P> 131The 132purpose of the program is to exchange data with other systems. You can use 133the program's <I>get</I> command to copy a file from the remote system to your 134local system: 135<UL> 136<PRE>get README.txt</PRE> 137</UL> 138 <P> 139The program will display the progress of the transfer on the screen, 140so you can tell how much needs to be done before the transfer finishes. 141When the transfer does finish, then you can enter more commands to the 142program's command shell. <P> 143You can use the program's <I>put</I> command to copy a file 144from your system to the remote system: 145<UL> 146<PRE>put something.tar</PRE> 147</UL> 148 <P> 149When you are finished using the remote system, you can open another one 150or use the <I>quit</I> <P> 151Before quitting, you may want to save the current FTP session's 152settings for later. You can use the <I>bookmark</I> command to save an entry into 153your $HOME/.ncftp/bookmarks file. When you use the <I>bookmark</I> command, you 154also specify a bookmark name, so the next time instead of opening the full 155hostname you can use the name of the bookmark. A bookmark acts just like 156one for your web browser, so it saves the remote directory you were in, 157the account name you used, etc., and other information it learned so that 158the next time you use the bookmark it should require as little effort from 159you as possible. <P> 160 161<H3><A NAME="sect4" HREF="#toc4">Command Reference</A></H3> 162 163<pre>help</pre> 164 165<DL> 166 167<DD>The first command to know is <I>help</I>. 168If you just type</DD> 169 170</DL> 171 172<UL> 173 <UL> 174 <pre>help</pre> 175 </UL> 176</UL> 177 178<DL> 179 180<UL> 181 182<DT> from the command shell, the program prints the names of all of the 183 supported commands. From there, you can get specific help for a command 184by typing the command after, for example: </DT> 185</UL> 186</DL> 187 188<UL> 189 <UL> 190 <pre>help open</pre> 191 </UL> 192</UL> 193 194<DL> 195 196<UL> 197 198</UL> 199 200<ul> prints information about the <i>open</i> command. </ul> 201 202 <dd> </dd> 203</DL> 204 205<pre>ascii</pre> 206 207<DL> 208 209<DD> This command 210sets the transfer type to ASCII text. This is useful for text-only transfers 211because the concept of text files differs between operating systems. For 212example on UNIX, a text file denotes line breaks with the linefeed character, 213while on MS-DOS a line break is denoted by both a carriage return character 214and a line feed character. Therefore, for data transfers that you consider 215the data as text you can use <I>ascii</I> to ensure that both the remote system 216and local system translate accordingly. The default transfer type that <I>ncftp</I> 217uses is not ASCII, but straight binary. </DD> 218 219<dt> </dt> 220</DL> 221 222<pre>bgget, bgput</pre> 223 224<DL> 225 226<DD> These commands 227correspond to the <I>get</I> and <I>put</I> commands explained below, except that they 228do the job in the background. Normally when you do a <I>get</I> then the program 229does the download immediately, and does not return control to you until 230the download completes. The background transfers are nice because you can 231continue browsing the remote filesystem and even open other systems. In 232fact, they are done by a daemon process, so even if you log off your UNIX 233host the daemon should still do your transfers. The daemon will also automatically 234continue to retry the transfers until they finish. To tell when background 235jobs have finished, you have to examine the <I>$HOME/.ncftp/spool/log</I> file, 236or run the <I>jobs</I> command from within <I>NcFTP</I>. </DD> 237 238<dt> </dt> 239<DD>Both the <I>bgget</I> and <I>bgput</I> commands 240allow you to schedule when to do the transfers. They take a ``-@'' parameter, 241whose argument is a date of the form YYYYMMDDhhmmss (four digit year, month, 242day, hour, minute, second). For example, to schedule a download at 3 AM 243on November 6, you could try:</DD> 244 245</DL> 246 247<UL> 248 <UL> 249 <pre>bgget -@ 19971106030000 /pub/idstuff/quake/q2_100.zip</pre> 250 <pre> </pre> 251 </UL> 252</UL> 253<pre>bgstart</pre> 254 255<DL> 256 257<DD> This command 258tells <I>ncftp</I> to immediately start the background transfers you've requested, 259which simply runs a copy of the <I>ncftpbatch</I> program which is responsible 260for the background jobs. Normally the program will start the background 261job as soon as you close the current site, open a new site, or quit the 262program. The reason for this is because since so many users still use slow 263dialup links that starting the transfers would slow things to a crawl, 264making it difficult to browse the remote system. An added bonus of starting 265the background job when you close the site is that <I>ncftp</I> can pass off that 266open connection to the <I>ncftpbatch</I> program. That is nice when the site is 267always busy, so that the background job doesn't have to wait and get re-logged 268on to do its job. </DD> 269 270<DT> </DT> 271</DL> 272 273<pre>binary</pre> 274 275<DL> 276 277<DD> Sets the transfer type to raw binary, so that 278no translation is done on the data transferred. This is the default anyway, 279since most files are in binary. </DD> 280 281<dt> </dt> 282</DL> 283 284<pre>bookmark</pre> 285 286<DL> 287 288<DD> Saves the current session settings 289for later use. This is useful to save the remote system and remote working 290directory so you can quickly resume where you left off some other time. 291The bookmark data is stored in your <I>$HOME/.ncftp/bookmarks</I> file. </DD> 292 293<dt> </dt> 294</DL> 295 296<pre>bookmarks</pre> 297 298<DL> 299 300<DD> 301Lists the contents of your <I>$HOME/.ncftp/bookmarks</I> file in a human-readable 302format. You can use this command to recall the bookmark name of a previously 303saved bookmark, so that you can use the <I>open</I> command with it. </DD> 304 305<dt> </dt> 306</DL> 307 308<pre>cat</pre> 309 310<DL> 311 312<DD> Acts 313like the ``/bin/cat'' <I>UNIX</I> command, only for remote files. This downloads the 314file you specify and dumps it directly to the screen. You will probably 315find the <I>page</I> command more useful, since that lets you view the file one 316screen at a time instead of printing the entire file at once. </DD> 317 318<dt> </dt> 319</DL> 320 321<pre>cd</pre> 322 323<DL> 324 325<DD> Changes 326the working directory on the remote host. Use this command to move to different 327areas on the remote server. If you just opened a new site, you might be 328in the root directory. Perhaps there was a directory called ``/pub/news/comp.sources.d'' 329that someone told you about. From the root directory, you could:</DD> 330 331</DL> 332 333<UL> 334 <UL> 335 <pre>cd pub 336cd news 337cd comp.sources.d</pre> 338 </UL> 339</UL> 340 341<DL> 342 343<UL> 344 345<DT> or, more concisely, </DT> 346</UL> 347</DL> 348 349<UL> 350 <UL> 351 <pre>cd /pub/news/comp.sources.d</pre> 352 </UL> 353</UL> 354 355<DL> 356 357<UL> 358 359</UL> 360<DD> Then, commands such as <I>get</I>, <I>put</I>, and <I>ls</I> could 361be used to refer to items in that directory. Some shells in the <I>UNIX</I> environment 362have a feature I like, which is switching to the previous directory. Like 363those shells, you can do:</DD> 364 365</DL> 366 367<UL> 368 <UL> 369 <pre>cd -</pre> 370 </UL> 371 <p> to change to the last directory you were in.</p> 372</UL> 373<pre> </pre> 374<pre>chmod</pre> 375 376<DL> 377 378<DD> Acts like the 379``/bin/chmod'' <I>UNIX</I> command, only for remote files. However, this is not a standard 380command, so remote FTP servers may not support it. </DD> 381 382<dt> </dt> 383</DL> 384 385<pre>close</pre> 386 387<DL> 388 389<DD> Disconnects you 390from the remote server. The program does this for you automatically when 391needed, so you can simply open other sites or quit the program without 392worrying about closing the connection by hand. </DD> 393 394<dt> </dt> 395</DL> 396 397<pre>debug</pre> 398 399<DL> 400 401<DD> This command is mostly 402for internal testing. You could type</DD> 403 404</DL> 405 406<UL> 407 <UL> 408 <pre>debug 1</pre> 409 </UL> 410</UL> 411 412<DL> 413 414<UL> 415 416</UL> 417<DD> to turn debugging mode on. Then you could see all messages between 418the program and the remote server, and things that are only printed in 419debugging mode. However, this information is also available in the <I>$HOME/.ncftp/trace</I> 420file, which is created each time you run <I>ncftp</I>. If you need to report a 421bug, send a <I>trace</I> file if you can. </DD> 422 423<dt> </dt> 424</DL> 425 426<pre>dir</pre> 427 428<DL> 429 430<DD> Prints a detailed directory listing. 431It tries to behave like <I>UNIX</I>'s ``/bin/ls -l'' command. If the remote server seems 432to be a <I>UNIX</I> host, you can also use the same flags you would with <I>ls</I>, for 433instance</DD> 434 435</DL> 436 437<UL> 438 <UL> 439 <pre>dir -rt</pre> 440 </UL> 441</UL> 442 443<DL> 444 445<UL> 446 447<DT> would try to act like </DT> 448</UL> 449</DL> 450 451<UL> 452 <UL> 453 <pre>/bin/ls -lrt</pre> 454 </UL> 455 <p>would on <i>UNIX</i>.</p> 456 <p> </p> 457</UL> 458 459</DL> 460 461<pre>edit</pre> 462 463<DL> 464 465<DD> Downloads into a temporary file for editing on the local host, 466then uploads the changed file back to the remote host. </DD> 467 468<dt> </dt> 469</DL> 470 471<pre>get</pre> 472 473<DL> 474 475<DD> Copies files from the current working 476directory on the remote host to your machine's current working directory. 477To place a copy of ``README'' and ``README.too'' in your local directory, you could 478try:</DD> 479 480</DL> 481 482<UL> 483 <UL> 484 <p> get README README.too</p> 485 </UL> 486</UL> 487 488<DL> 489 490<UL> 491 492<DT> You could also accomplish that by using a wildcard 493expression, such as: </DT> 494</UL> 495</DL> 496 497<UL> 498 <UL> 499 <pre>get README*</pre> 500 </UL> 501</UL> 502 503<DL> 504 505<DD> This command is similar to the behavior of other FTP programs' <I>mget</I> command. To retrieve a remote file but give it a different name on 506your host, you can use the ``-z'' flag. This example shows how to download a 507file called <I>ReadMe.txt</I> but name it locally as <I>README</I>:</DD> 508 509</DL> 510 511<UL> 512 <UL> 513 <pre>get -z ReadMe.txt README</pre> 514 </UL> 515</UL> 516 517<DL> 518 519<DD> The program tries to ``resume'' downloads by default. This means that if the remote FTP server lost the connection and was only 520able to send 490 kilobytes of a 500 kilobyte file, you could reconnect 521to the FTP server and do another <I>get</I> on the same file name and it would 522get the last 10 kilobytes, instead of retrieving the entire file again. 523There are some occasions where you may not want that behavior. To turn it 524off you can use the ``-f'' flag. </DD> 525 526<DT> </DT> 527<DD>There are also times where you want to append 528to an existing file. You can do this by using the ``-A'' flag, for example</DD> 529 530</DL> 531 532<UL> 533 <UL> 534 <pre>get -A log.11</pre> 535 </UL> 536</UL> 537 538<DL> 539 540<UL> 541 542</UL> 543 544<ul><P>would append to a file named ``log.11'' if it existed locally. 545 546<p>Another thing you can do is delete a remote file after you download it. 547This can be useful when a remote host expects a file to be removed when 548it has been retrieved. Use the double-D flag, such as ``get -DD'' to do this. </ul> 549 550<DT> 551</DT> 552<DD>The <I>get</I> command lets you retrieve entire directory trees, too. Although it may 553not work with some remote systems, you can try ``get -R'' with a directory to 554download the directory and its contents. </DD> 555 556<dt> </dt> 557 558<DD>When using the ``-R'' flag, you can also use the ``-T'' flag to disable 559automatic on-the-fly TAR mode for downloading whole directory trees. 560 The program uses TAR whenever possible since this usually preserves symbolic links 561 and file permissions. TAR mode can also result in faster transfers for directories containing many 562 small files, since a single data connection can be used rather than an FTP 563 data connection for each small file. The downside to using TAR is that it forces downloading of the whole directory, 564 even if you had previously downloaded a portion of it earlier, so you may want to use this option if you want to resume downloading of a directory. </DD> 565<dt> </dt> 566 567</DL> 568 569<pre>jobs</pre> 570 571<DL> 572 573<DD> Views the list of currently 574executing <I>NcFTP</I> background tasks. This actually just runs <I>ncftpbatch</I> -l 575for you. </DD> 576 577<dt> </dt> 578</DL> 579 580<pre>lcd</pre> 581 582<DL> 583 584<DD> The <I>lcd</I> command is the first of a few ``l'' commands that work 585with the local host. This changes the current working directory on the local 586host. If you want to download files into a different local directory, you 587could use <I>lcd</I> to change to that directory and then do your downloads. </DD> 588 589<dt> </dt> 590</DL> 591 592<pre>lchmod</pre> 593 594<DL> 595 596<DD> 597Runs ``/bin/chmod'' on the local host. </DD> 598 599<dt> </dt> 600</DL> 601 602<pre>lls</pre> 603 604<DL> 605 606<DD> Another local command that comes 607in handy is the <I>lls</I> command, which runs ``/bin/ls'' on the local host and displays 608the results in the program's window. You can use the same flags with <I>lls</I> 609as you would in your command shell, so you can do things like:</DD> 610 611</DL> 612 613<UL> 614 <UL> 615 <pre>lcd ~/doclls -lrt p*.txt</pre> 616 <pre> </pre> 617 </UL> 618</UL> 619<pre>lmkdir</pre> 620 621<DL> 622 623<DD> Runs ``/bin/mkdir'' on the local host. </DD> 624 625<dt> </dt> 626</DL> 627 628<tt>lookup</tt> 629 630<UL> 631<P>The program also has a built-in interface to the name service via the <I>lookup</I> 632command. This means you can lookup entries for remote hosts, like:</P> 633<UL> 634<pre>lookup cse.unl.edu ftp.cs.unl.edu sphygmomanometer.unl.edu</pre> 635</UL> 636<P>prints: 637 638<UL> 639 640<pre>cse.unl.edu 129.93.33.1 641typhoon.unl.edu 129.93.33.24 642sphygmomanometer.unl.edu 129.93.33.126</pre> 643 644</UL> 645 646<p> There is also a more detailed option, enabled with ``-v,'' i.e.: </p> 647<UL> 648<pre>lookup -v cse.unl.edu ftp.cs.unl.edu</pre> 649 650</UL> 651 652<p>prints:</p> 653<UL> 654<pre>cse.unl.edu: 655 Name: cse.unl.edu 656 Address: 129.93.33.1 657 658ftp.cs.unl.edu: 659 Name: typhoon.unl.edu 660 Alias: <a href="ftp://ftp.cs.unl.edu">ftp.cs.unl.edu</a> 661 Address: 129.93.33.24</pre> 662 663</UL> 664 665<p>You can also give <I>IP</I> addresses, so this would work too:</p> 666<UL> 667 <pre>lookup 129.93.33.24</pre> 668</UL> 669<p> prints: </p> 670<UL> 671<pre>typhoon.unl.edu 129.93.33.24</pre> 672 673</UL> 674 675</UL> 676 677<pre>lpage</pre> 678 679<DL> 680 681<DD> Views a local file one page at a time, 682with your preferred $PAGER program. </DD> 683 684<dt> </dt> 685</DL> 686 687<pre>lpwd</pre> 688 689<DL> 690 691<DD> Prints the current local directory. 692Use this command when you forget where you are on your local machine. </DD> 693 694<dt> </dt> 695</DL> 696 697<pre>lrename</pre> 698 699<DL> 700 701<DD> 702Runs ``/bin/mv'' on the local host. </DD> 703 704<dt> </dt> 705</DL> 706 707<pre>lrm</pre> 708 709<DL> 710 711<DD> Runs ``/bin/rm'' on the local host. </DD> 712 713<dt> </dt> 714</DL> 715 716<pre>lrmdir</pre> 717 718<DL> 719 720<DD> 721Runs ``/bin/rmdir'' on the local host. </DD> 722 723<dt> </dt> 724</DL> 725 726<pre>ls</pre> 727 728<DL> 729 730<DD> Prints a directory listing from the 731remote system. It tries to behave like <I>UNIX</I>'s ``/bin/ls -CF'' command. If the remote 732server seems to be a <I>UNIX</I> host, you can also use the same flags you would 733with <I>ls</I>, for instance</DD> 734 735</DL> 736 737<UL> 738 <UL> 739 <pre>ls -rt</pre> 740 </UL> 741</UL> 742 743<DL> 744 745<UL> 746 747<DT> would try to act like </DT> 748</UL> 749</DL> 750 751<UL> 752 <UL> 753 <pre>/bin/ls -CFrt</pre> 754 </UL> 755</UL> 756 757<DL> 758 759<UL> 760<P> would on <i>UNIX</i>.</p> 761</UL> 762 763<DD><I>ncftp </I>has a powerful built-in system for dealing 764with directory listings. It tries to cache each one, so if you list the 765same directory, odds are it will display instantly. Behind the scenes, <I>ncftp</I> 766always tries a long listing, and then reformats it as it needs to. So even 767if your first listing of a directory was a regular ``ls'' which displayed the 768files in columns, your next listing could be ``ls -lrt'' and <I>ncftp</I> would still 769use the cached directory listing to quickly display the information for 770you! </DD> 771 772<dt> </dt> 773</DL> 774 775<pre>mkdir</pre> 776 777<DL> 778 779<DD> Creates a new directory on the remote host. For many public 780archives, you won't have the proper access permissions to do that. </DD> 781 782<dt> </dt> 783</DL> 784 785<pre>open</pre> 786 787<DL> 788 789<DD> 790Establishes an FTP control connection to a remote host. By default, <I>ncftp</I> 791logs in anonymously to the remote host. You may want to use a specific user 792account when you log in, so you can use the ``-u'' flag to specify which user. 793This example shows how to <I>open</I> the host ``bowser.nintendo.co.jp'' using the username 794``mario:''</DD> 795 796</DL> 797 798<UL> 799 <UL> 800 <pre>open -u mario bowser.nintendo.co.jp</pre> 801 </UL> 802 803 <P>Here is a list of flags you can use with the open command: 804<UL> 805<table width=100%> 806 <tr> 807 <td width=50><B>-u</B> <I>XX</I></td> 808 <td>Use username <I>XX</I> instead of anonymous.</td> 809 </tr> 810 <tr> 811 <td width=50><B>-p</B> <I>XX</I></td> 812 <td>Use password <I>XX</I> with the username.</td> 813 </tr> 814 <tr> 815 <td width=50><B>-j</B> <I>XX</I></td> 816 <td>Use account <I>XX</I> in supplement to the username and password (deprecated)</td> 817 </tr> 818 <tr> 819 <td width=50><B>-P</B> <I>XX</I></td> 820 <td>Use port number <I>XX</I> instead of the default FTP service port (21).</td> 821 </tr> 822</table> 823</UL> 824 825</UL> 826 827<pre>page</pre> 828 829<DL> 830 831<DD> Browses a remote file one page 832at a time, using your $PAGER program. This is useful for reading README's 833on the remote host without downloading them first. </DD> 834 835<dt> </dt> 836</DL> 837 838<pre>pdir, pls</pre> 839 840<DL> 841 842<DD> These commands 843are equivalent to <I>dir</I> and <I>ls</I> respectively, only they feed their output 844to your pager. These commands are useful if the directory listing scrolls 845off your screen. </DD> 846 847<dt> </dt> 848</DL> 849 850<pre>put</pre> 851 852<DL> 853 854<DD> Copies files from the local host to the remote machine's 855current working directory. To place a copy of ``xx.zip'' and ``yy.zip'' in the remote 856directory, you could try:</DD> 857 858</DL> 859 860<UL> 861 <UL> 862 <pre>put xx.zip yy.zip</pre> 863 </UL> 864 865<DL> 866 867<DT> You could also accomplish that by using a wildcard expression, such as: 868</DT> 869</DL> 870 871 <UL> 872 <pre>put *.zip</pre> 873 </UL> 874</UL> 875 876<DL> 877 878<DD> This command is similar to the behavior of other FTP programs' <I>mput</I> command. To send a remote file but give it a different name on your 879host, you can use the ``-z'' flag. This example shows how to upload a file called 880``ncftpd-2.0.6.tar.gz'' but name it remotely as ``NFTPD206.TGZ:''</DD> 881 882</DL> 883 884<UL> 885 <UL> 886 <pre>put -z ncftpd-2.0.6.tar.gz NFTPD206.TGZ</pre> 887 </UL> 888</UL> 889 890<DL> 891 892<DD> The program <I>does</I> not try to ``resume'' uploads 893by default. If you do want to resume an upload, use the ``-z'' flag. </DD> 894 895<DD> </DD> 896 897<DD>There are 898also times where you want to append to an existing remote file. You can 899do this by using the ``-A'' flag, for example </DD> 900 901</DL> 902 903<UL> 904 <UL> 905 <pre>put -A log11.txt</pre> 906 </UL> 907</UL> 908 909<DL> 910 911<UL> 912<p> would append to a file named ``log11.txt'' if it existed on 913the remote server. </p> 914</UL> 915 916<DD>Another thing you can do is delete a local file after 917you upload it. Use the double-D flag, such as ``put -DD'' to do this. </DD> 918 919<DT> </DT> 920<DD>The <I>put</I> command 921lets you send entire directory trees, too. It should work on all remote 922systems, so you can try ``put -R'' with a directory to upload the directory and 923its contents. </DD> 924 925<dt> </dt> 926</DL> 927 928<pre>pwd</pre> 929 930<DL> 931 932<DD> Prints the current remote working directory. A portion 933of the pathname is also displayed in the shell's prompt. </DD> 934 935<dt> </dt> 936</DL> 937 938<pre>quit</pre> 939 940<DL> 941 942<DD> Of course, 943when you finish using the program, type <I>quit</I> to end the program (You could 944also use <I>bye</I>, <I>exit</I>, or <I>^D</I>). </DD> 945 946<dt> </dt> 947</DL> 948 949<pre>quote</pre> 950 951<DL> 952 953<DD> This can be used to send a direct <I>FTP</I> 954Protocol command to the remote server. Generally this isn't too useful to 955the average user. </DD> 956 957<dt> </dt> 958</DL> 959 960<pre>rename</pre> 961 962<DL> 963 964<DD> If you need to change the name of a remote file, 965you can use the <I>rename</I> command, like:</DD> 966 967</DL> 968 969<UL> 970 <UL> 971 <pre>rename SPHYGMTR.TAR sphygmomanometer-2.3.1.tar</pre> 972 </UL> 973</UL> 974<p> </p> 975<pre>rhelp</pre> 976 977<DL> 978 979<DD> Sends a help request 980to the remote server. The list of <I>FTP</I> Protocol commands is often printed, 981and sometimes some other information that is actually useful, like how 982to reach the site administrator. Depending on the remote server, you may 983be able to give a parameter to the server also, like: </DD> 984 985</DL> 986 987<UL> 988 <UL> 989 <pre>rhelp NLST</pre> 990 </UL> 991</UL> 992 993<DL> 994 995<UL> 996 997<DT> One server responded: </DT> 998</UL> 999</DL> 1000 1001<UL> 1002 <UL> 1003 <pre>Syntax: NLST [ <sp> path-name ]</pre> 1004 </UL> 1005</UL> 1006 1007<DL> 1008 1009<DD> </DD> 1010 1011</DL> 1012 1013<pre>rm</pre> 1014 1015<DL> 1016 1017<DD> If you need to delete a remote file 1018you can try the <I>rm</I> command. Much of the time this won't work because you 1019won't have the proper access permissions. This command doesn't accept any 1020flags, so you can't nuke a whole tree by using ``-rf'' flags like you can on 1021<I>UNIX</I>. </DD> 1022 1023<dt> </dt> 1024</DL> 1025 1026<pre>rmdir</pre> 1027 1028<DL> 1029 1030<DD> Similarly, the <I>rmdir</I> command removes a directory. Depending 1031on the remote server, you may be able to remove a non-empty directory, so 1032be careful. </DD> 1033 1034<dt> </dt> 1035</DL> 1036 1037<pre>set</pre> 1038 1039<DL> 1040 1041<DD> This lets you configure some program variables, which are 1042saved between runs in the <I>$HOME/.ncftp/prefs</I> file. The basic syntax is:</DD> 1043 1044</DL> 1045 1046<UL> 1047 <UL> 1048 <pre>set <option> <value></pre> 1049 </UL> 1050</UL> 1051 1052<DL> 1053 1054<UL> 1055 1056<DT> For example, to change the value you use for the anonymous 1057password, you might do: </DT> 1058</UL> 1059</DL> 1060 1061<UL> 1062 <UL> 1063 <pre>set anon-password ncftp@example.com</pre> 1064 </UL> 1065</UL> 1066 1067<DL> 1068 1069<UL> 1070<p> See the <a href="#sect5"> next section</a> for a list of things 1071you change. </p> 1072</UL> 1073 1074</DL> 1075 1076<pre>show</pre> 1077 1078<DL> 1079 1080<DD> This lets you display program variables. You can do ``show all'' 1081to display all of them, or give a variable name to just display that one, 1082such as:</DD> 1083 1084</DL> 1085 1086<UL> 1087 <UL> 1088 <pre>show anon-password</pre> 1089 </UL> 1090</UL> 1091 1092<DL> 1093 1094<DD> </DD> 1095 1096</DL> 1097 1098<pre>site</pre> 1099 1100<DL> 1101 1102<DD> One obscure command you may have to use someday 1103is <I>site</I>. The <I>FTP</I> Protocol allows for ``site specific'' commands. These ``site'' commands 1104vary of course, such as:</DD> 1105 1106</DL> 1107 1108<UL> 1109 <UL> 1110 <pre>site chmod 644 README</pre> 1111 </UL> 1112</UL> 1113 1114<UL> 1115<p> Actually, <I>ncftp</I>'s <I>chmod</I> command really does the 1116above. </p> 1117 1118<p>Try doing one of these to see what the remote server supports, if 1119any: </p> 1120</UL> 1121 1122<UL> 1123 <UL> 1124 <P><TT>rhelp SITE</TT> 1125 <BR><TT>site help</TT> 1126 </UL> 1127</UL> 1128 1129<DL> 1130 1131<DD> </DD> 1132 1133</DL> 1134 1135<pre>type</pre> 1136 1137<DL> 1138 1139<DD> You may need to change transfer types during 1140the course of a session with a server. You can use the <I>type</I> command to do 1141this. Try one of these:</DD> 1142 1143</DL> 1144 1145<UL> 1146 <UL> 1147 <pre>type ascii 1148type binary 1149type image</pre> 1150 </UL> 1151</UL> 1152 1153<DL> 1154 1155<DD> The <I>ascii</I> command is equivalent to ``type a'', 1156and the <I>binary</I> command is equivalent to ``type i'' and ``type b''. </DD> 1157 1158<dt> </dt> 1159</DL> 1160 1161<pre>umask</pre> 1162 1163<DL> 1164 1165<DD> Sets the 1166process' <I>umask</I> on the remote server, if it has any concept of a umask, i.e.:</DD> 1167 1168</DL> 1169 1170<UL> 1171 <UL> 1172 <pre>umask 077</pre> 1173 </UL> 1174</UL> 1175 1176<UL> 1177<p> However, this is not a standard command, so remote FTP servers may not support it.</p> 1178</UL> 1179<br> 1180 1181<pre>version</pre> 1182 1183<DL> 1184 1185<DD> This command dumps some information about the 1186particular edition of the program you are using, and how it was installed 1187on your system. </DD> 1188<dt> </dt> 1189</DL> 1190 1191<H3><A NAME="sect5" HREF="#toc5">Variable Reference</A></H3> 1192 1193<pre>anon-password</pre> 1194 1195<DL> 1196 1197<DD> Specifies what to use 1198for the password when logging in anonymously. Internet convention has been 1199to use your E-mail address as a courtesy to the site administrator. If you 1200change this, be aware that some sites require (i.e. they check for) valid 1201E-mail addresses. </DD> 1202 1203<dt> </dt> 1204</DL> 1205 1206<pre>auto-ascii</pre> 1207 1208<DL> 1209 1210<DD> If set to a list of pipe-character delimited extensions, files with 1211these extensions will be sent in ASCII mode even if binary mode is 1212currently in effect. This option allows you to transfer most files in 1213binary, with the exception of a few well-known file types that should be 1214sent in ASCII. This option is enabled by default, and set to a list 1215of common extensions (e.g., <tt>.txt</tt> and <tt>.html</tt>).</DD> 1216 1217<dt> </dt> 1218</DL> 1219 1220<pre>auto-resume</pre> 1221 1222<DL> 1223<DD> 1224<I>NcFTP</I> 3 now prompts the user by default when you 1225try to download a file that already exists locally, 1226or upload a file that already exists remotely. 1227Older versions of the program automatically guessed 1228whether to overwrite the existing file or attempt 1229to resume where it left off, but sometimes the program 1230would guess wrong. If you would prefer that 1231the program always guess which action to take, set 1232this variable to <i>yes</i>, otherwise, leave it set to <i>no</i> 1233and the program will prompt you for which action to 1234take. 1235</DD> 1236<dt> </dt> 1237</DL> 1238 1239<pre>autosave-bookmark-changes</pre> 1240 1241<DL> 1242 1243<DD> With the advent of version 3 of 1244<I>NcFTP</I>, the program treats bookmarks more like they would with your web 1245browser, which means that once you bookmark the site, the remote directory 1246is static. If you set this variable to <I>yes</I>, then the program will automatically 1247update the bookmark's starting remote directory with the directory you were 1248in when you closed the site. This behavior would be more like that of <I>NcFTP</I> 1249version 2. </DD> 1250 1251<dt> </dt> 1252</DL> 1253 1254<pre>confirm-close</pre> 1255 1256<DL> 1257 1258<DD> By default the program will ask you when a site 1259you haven't bookmarked is about to be closed. To turn this prompt off, you 1260can set this variable to <I>no</I>. </DD> 1261 1262<dt> </dt> 1263</DL> 1264 1265<pre>connect-timeout</pre> 1266 1267<DL> 1268 1269<DD> Previous versions of the program 1270used a single timeout value for everything. You can now have different values 1271for different operations. However, you probably do not need to change these 1272from the defaults unless you have special requirements. </DD> 1273 1274<DT> </DT> 1275<DD>The <I>connect-timeout</I> 1276variable controls how long to wait, in seconds, for a connection establishment 1277to complete before considering it hopeless. You can choose to not use a 1278timeout at all by setting this to -1. </DD> 1279 1280<dt> </dt> 1281</DL> 1282 1283<pre>control-timeout</pre> 1284 1285<DL> 1286 1287<DD> This is the timer used 1288when <I>ncftp</I> sends an FTP command over the control connection to the remote 1289server. If the server hasn't replied in that many seconds, it considers the 1290session lost. </DD> 1291 1292<dt> </dt> 1293</DL> 1294 1295<pre>logsize</pre> 1296 1297<DL> 1298 1299<DD> This is controls how large the transfer log ($HOME/.ncftp/log) 1300can grow to, in kilobytes. The default is 200, for 200kB; if you don't want 1301a log, set this to 0. </DD> 1302 1303<dt> </dt> 1304</DL> 1305 1306<pre>pager</pre> 1307 1308<DL> 1309 1310<DD> This is the external program to use to view 1311a text file, and is <I>more</I> by default. </DD> 1312 1313<dt> </dt> 1314</DL> 1315 1316<pre>passive</pre> 1317 1318<DL> 1319 1320<DD> This controls <I>ncftp</I>'s behavior 1321for data connections, and can be set to one of <I>on</I>, <I>off</I>, or the default, 1322<I>optional</I>. When passive mode is on, <I>ncftp</I> uses the FTP command primitive 1323<I>PASV</I> to have the client establish data connections to the server. The default 1324FTP protocol behavior is to use the FTP command primitive <I>PORT</I> which has 1325the server establish data connections to the client. The default setting 1326for this variable, <I>optional</I>, allows <I>ncftp</I> to choose whichever method it 1327deems necessary. </DD> 1328 1329<dt> </dt> 1330</DL> 1331 1332<pre>progress-meter</pre> 1333 1334<DL> 1335 1336<DD> You can change how the program reports file 1337transfer status. Select from meter <I>2</I>, <I>1</I>, or <I>0</I>. </DD> 1338 1339<dt> </dt> 1340 1341</DL> 1342 1343<pre>redial-delay</pre> 1344 1345<UL> 1346<P>When a host is busy or unavailable, the program waits this number of seconds before trying again. 1347 The smallest you can set this is to 10 seconds -- so if you were planning on being inconsiderate, 1348 think again. </P> 1349</UL> 1350 1351<pre>save-passwords</pre> 1352 1353<DL> 1354 1355<DD> If you set 1356this variable to <I>yes</I>, the program will save passwords along with the bookmarks 1357you save. While this makes non-anonymous logins more convenient, this can 1358be very dangerous since your account information is now sitting in the 1359$HOME/.ncftp/bookmarks file. The passwords aren't in clear text, but it is 1360still trivial to decode them if someone wants to make a modest effort. 1361</DD> 1362 1363<dt> </dt> 1364</DL> 1365 1366<pre>show-status-in-xterm-titlebar</pre> 1367 1368<DL> 1369 1370<DD> If set to <I>yes</I> and operating from within an <i>xterm</i> window, 1371the program will change the window's titlebar accordingly. </DD> 1372 1373<dt> </dt> 1374</DL> 1375 1376<pre>so-bufsize</pre> 1377 1378<DL> 1379 1380<DD> If your operating system supports <i> TCP Large Windows</i>, you can 1381try setting this variable to the number of bytes to set the TCP/IP socket 1382buffer to. This option won't be of much use unless the remote server also 1383supports large window sizes and is pre-configured with them enabled. </DD> 1384 1385<dt> </dt> 1386</DL> 1387 1388<pre>xfer-timeout</pre> 1389 1390<DL> 1391 1392<DD> 1393This timer controls how long to wait for data blocks to complete. Don't set 1394this too low or else your transfers will timeout without completing. </DD> 1395<dt> </dt> 1396</DL> 1397 1398<H3><A NAME="sect6" HREF="#toc6">Firewall 1399and Proxy Configuration</A></H3> 1400 <P> 1401You may find that your network administrator has 1402placed a firewall between your machine and the Internet, and that you cannot 1403reach external hosts. <P> 1404The answer may be as simple as setting <I>ncftp</I> to use 1405<I>passive</I> mode only, which you can do from a <I>ncftp</I> command prompt like this: 1406<UL> 1407<PRE>set passive yes</PRE> 1408</UL> 1409 <P> 1410The reason for this is because many firewalls do not allow incoming connections 1411to the site, but do allow users to establish outgoing connections. A passive 1412data connection is established by the client to the server, whereas the 1413default is for the server to establish the connection to the client, which 1414firewalls may object to. Of course, you now may have problems with sites 1415whose primitive FTP servers do not support passive mode. <P> 1416Otherwise, if you 1417know you need to have <I>ncftp</I> communicate directly with a firewall or proxy, 1418you can try editing the separate <I>$HOME/.ncftp/firewall</I> configuration file. 1419This file is created automatically the first time you run the program, 1420and contains all the information you need to get the program to work in 1421this setup. <P> 1422The basics of this process are configuring a firewall (proxy) 1423host to go through, a user account and password for authentication on the 1424firewall, and which type of firewall method to use. You can also setup an 1425exclusion list, so that <I>ncftp</I> does not use the firewall for hosts on the 1426local network. <P> 1427 1428<H2><A NAME="sect7" HREF="#toc7">Files</A></H2> 1429 1430<UL> 1431 1432<DL> 1433 1434<DT><tt>$HOME/.ncftp/bookmarks</tt></DT> 1435<DD>Saves bookmark and host information. 1436</DD> 1437 1438<DT><tt>$HOME/.ncftp/firewall</tt></DT> 1439<DD>Firewall access configuration file. </DD> 1440 1441<DT><tt>$HOME/.ncftp/prefs</tt></DT> 1442<DD>Program 1443preferences. </DD> 1444 1445<DT><tt>$HOME/.ncftp/trace</tt></DT> 1446<DD>Debugging output 1447for entire program run. </DD> 1448 1449<DT><tt>$HOME/.ncftp/v3init</tt></DT> 1450<DD>Used to tell if this version of 1451the program has run before. </DD> 1452 1453<DT><tt>$HOME/.ncftp/spool/</tt></DT> 1454<DD>Directory where background jobs are stored 1455in the form of spool configuration files. </DD> 1456 1457<DT><tt>$HOME/.ncftp/spool/log</tt></DT> 1458<DD>Information for background data 1459transfer processes. </DD> 1460 1461</DL> 1462 1463</UL> 1464 1465<H2><A NAME="sect8" HREF="#toc8">Environment</A></H2> 1466 1467<UL> 1468 1469<DL> 1470 1471<DT>PATH</DT> 1472<DD>User's search path, used to 1473find the <I>ncftpbatch</I> program, pager, and some other system utilities. </DD> 1474 1475<DT>PAGER</DT> 1476<DD>Program 1477to use to view text files one page at a time. </DD> 1478 1479<DT>TERM</DT> 1480<DD>If the program was compiled 1481with support for <I>GNU Readline</I> it will need to know how to manipulate the 1482terminal correctly for line-editing, etc. The pager program will also take 1483advantage of this setting. </DD> 1484 1485<DT>HOME</DT> 1486<DD>By default, the program writes its configuration 1487data in a <I>.ncftp</I> subdirectory of the <I>HOME</I> directory. </DD> 1488 1489<DT>NCFTPDIR</DT> 1490<DD>If set, the 1491program will use this directory instead of <I>$HOME/.ncftp</I>. This variable is 1492optional except for those users whose home directory is the root directory. 1493</DD> 1494 1495<DT>COLUMNS</DT> 1496<DD>Both the built-in <I>ls</I> command and the external <I>ls</I> command need this 1497to determine how many screen columns the terminal has. </DD> 1498</DL> 1499 1500</UL> 1501 1502<H2><A NAME="sect9" HREF="#toc9">Bugs</A></H2> 1503<UL> 1504 <P> 1505There are no 1506such sites named <I>bowser.nintendo.co.jp</I> or <I>sphygmomanometer.unl.edu</I>. <P> 1507Auto-resume 1508should check the file timestamps instead of relying upon just the file 1509sizes, but it is difficult to do this reliably within FTP. <P> 1510Directory caching 1511and recursive downloads depend on <I>UNIX</I>-like behavior of the remote host. 1512</UL> 1513 <P> 1514 1515 1516<H2><A NAME="sect10" HREF="#toc10">Author</A></H2> 1517<UL> 1518 <P> 1519Mike Gleason, NcFTP Software. 1520</UL> 1521 <P> 1522 1523<H2><A NAME="sect11" HREF="#toc11">See Also</A></H2> 1524<UL> 1525 <P> 1526<I><I>ncftpput</I>(1)</I>, 1527<I><I>ncftpget</I>(1)</I>, <I><I>ncftpbatch</I>(1)</I>, <I><I>ftp</I>(1)</I>, <I><I>rcp</I>(1)</I>, <I><I>tftp</I>(1)</I>. <P> 1528<I>LibNcFTP</I> (<a href="http://www.ncftp.com/libncftp/">http://www.ncftp.com/libncftp</a>/). 1529<P> 1530<I>NcFTPd</I> (<a href="http://www.ncftp.com/ncftpd/">http://www.ncftp.com/ncftpd/</a>). 1531</UL> 1532<P> 1533 1534<H2><A NAME="sect12" HREF="#toc12">Thanks</A></H2> 1535<UL> 1536 <P> 1537Thanks to everyone who uses 1538the program. Your support is what drives me to improve the program! <P> 1539I thank 1540Dale Botkin and Tim Russell at my former ISP, <I>Probe Technology</I>. <P> 1541Ideas and 1542some code contributed by my partner, Phil Dietz. <P> 1543Thanks to Brad Mittelstedt 1544and Chris Tjon, for driving and refining the development of the backbone 1545of this project, <I>LibNcFTP</I>. <P> 1546I'd like to thank my former system administrators, 1547most notably Charles Daniel, for making testing on a variety of platforms 1548possible, letting me have some extra disk space, and for maintaining the 1549UNL FTP site. <P> 1550For testing versions 1 and 2 above and beyond the call of 1551duty, I am especially grateful to: Phil Dietz, Kok Hon Yin, and Andrey A. Chernov 1552(ache@astral.msk.su). <P> 1553Thanks to Tim MacKenzie (t.mackenzie@trl.oz.au) for the 1554original filename completion code for version 2.3.0 and 2.4.2. <P> 1555Thanks to DaviD 1556W. Sanderson (dws@ora.com), for helping me out with the man page. <P> 1557Thanks to 1558those of you at <a href="http://www.unl.edu"> UNL</a> who appreciate my work. <P> 1559Thanks to Red Hat Software for 1560honoring my licensing agreement, but more importantly, thanks for providing 1561a solid and affordable development platform. 1562</UL> 1563 <P> 1564 1565<H2><A NAME="sect13" HREF="#toc13">Apologies</A></H2> 1566<UL> 1567 <P> 1568To the users, for 1569not being able to respond personally to most of your inquiries. <P> 1570To Phil, 1571for things not being the way they should be. 1572</UL> 1573 <P> 1574 1575<HR><P> 1576<A NAME="toc"><B>Table of Contents</B></A> 1577<UL> 1578<LI><A NAME="toc0" HREF="#sect0">Name</A></LI> 1579<LI><A NAME="toc1" HREF="#sect1">Synopsis</A></LI> 1580<LI><A NAME="toc2" HREF="#sect2">Description</A></LI> 1581<UL> 1582<LI><A NAME="toc3" HREF="#sect3">Introduction to the Command Shell</A></LI> 1583<LI><A NAME="toc4" HREF="#sect4">Command Reference</A></LI> 1584<LI><A NAME="toc5" HREF="#sect5">Variable Reference</A></LI> 1585<LI><A NAME="toc6" HREF="#sect6">Firewall and Proxy Configuration</A></LI> 1586</UL> 1587<LI><A NAME="toc7" HREF="#sect7">Files</A></LI> 1588<LI><A NAME="toc8" HREF="#sect8">Environment</A></LI> 1589<LI><A NAME="toc9" HREF="#sect9">Bugs</A></LI> 1590<LI><A NAME="toc10" HREF="#sect10">Author</A></LI> 1591<LI><A NAME="toc11" HREF="#sect11">See Also</A></LI> 1592<LI><A NAME="toc12" HREF="#sect12">Thanks</A></LI> 1593<LI><A NAME="toc13" HREF="#sect13">Apologies</A></LI> 1594</UL> 1595</BODY></HTML> 1596