.\"------- .\" Man page portability notes .\" .\" These are some notes on conventions to maintain for greatest .\" portability of this man page to various other versions of .\" nroff. .\" .\" When you want a \ to appear in the output, use \e in the man page. .\" (NOTE this comes up in the rc grammar, where to print out '\n' the .\" man page must contain '\en'.) .\" .\" Evidently not all versions of nroff allow the omission of the .\" terminal " on a macro argument. Thus what could be written .\" .\" .Cr "exec >[2] err.out .\" .\" in true nroffs must be written .\" .\" .Cr "exec >[2] err.out" .\" .\" instead. .\" .\" Use symbolic font names (e.g. R, I, B) instead of the standard .\" font positions 1, 2, 3. Note that for Xf to work the standard .\" font names must be single characters. .\" .\" Note that sentences should end at the end of a line. nroff and .\" troff will supply the correct intersentence spacing, but only if .\" the sentences end at the end of a line. Explicit spaces, if given, .\" are apparently honored and the normal intersentence spacing is .\" supressed. .\" .\" DaviD W. Sanderson .\"------- .\" Dd distance to space vertically before a "display" .\" These are what n/troff use for interparagraph distance .\"------- .if t .nr Dd .4v .if n .nr Dd 1v .\"------- .\" Sp space down the interparagraph distance .\"------- .de Sp .sp \\n(Ddu .. .\"------- .\" Ds begin a display, indented .5 inches from the surrounding text. .\" .\" Note that uses of Ds and De may NOT be nested. .\"------- .de Ds .Sp .in +0.5i .nf .. .\"------- .\" De end a display (no trailing vertical spacing) .\"------- .de De .fi .in .. .\"------- .\" Xs begins a display paragraph, indented .5 inches from the surrounding .\" text. Same as Ds, almost. .\"------- .de Xs .IP .in +0.5i .nf .. .\"------- .\" Xe end a display (no trailing vertical spacing) .\"------- .de Xe .fi .in .IP .. .TH ncftp 1 "NcFTP Software" ncftp .SH NAME ncftp - Browser program for the File Transfer Protocol .SH "SYNOPSIS" .PP .B ncftp .RI [ "host" ] .PP .B ncftp .RI [ "ftp://host.name/directory/" ] .\"------- .SH "DESCRIPTION" .\"------- .PP The purpose of .I ncftp is to provide a powerful and flexible interface to the Internet standard .IR "File Transfer Protocol" . It is intended to replace the stock .I ftp program that comes with the system. .PP Although the program appears to be rather spartan, you'll find that .I ncftp has a wealth of valuable performance and usage features. The program was designed with an emphasis on usability, and it does as much as it can for you automatically so you can do what you expect to do with a file transfer program, which is transfer files between two interconnected systems. .PP Some of the cooler features include progress meters, filename completion, command-line editing, background processing, auto-resume downloads, bookmarking, cached directory listings, host redialing, working with firewalls and proxies, downloading entire directory trees, etc., etc. .PP The .I ncftp distribution comes with the useful utility programs .IR ncftpget "(1)" and .IR ncftpput "(1)" which were designed to do command-line FTP. In particular, they are very handy for shell scripts. This version of .I ncftp no longer does command-line FTP, since the main .I ncftp program is more of a browser-type program. .\"------- .SS "OPTIONS" .\"------- The program allows you to specify a host or directory URL on the command line. This is a synonym for running .I ncftp and then using the .I open command. A few command-line flags are allowed with this mode: .TP 8 .BI "-u " "XX" Use username .I XX instead of anonymous. .TP 8 .BI "-p " "XX" Use password .I XX with the username. .TP 8 .BI "-j " "XX" Use account .I XX in supplement to the username and password (deprecated). .TP 8 .BI "-P " "XX" Use port number .I XX instead of the default FTP service port (21). .\"------- .SS "INTRODUCTION TO THE COMMAND SHELL" .\"------- .PP Upon running the program you are presented a command prompt where you type commands to the program's shell. Usually you will want to open a remote filesystem to transfer files to and from your local machine's filesystem. To do that, you need to know the symbolic name of the remote system, or its .I "Internet Protocol" (IP) address. For example, a symbolic name might be ``typhoon\.unl\.edu,'' and its IP address could be ``129.93.33.24.'' To open a connection to that system, you use the program's .I open command: .Ds open typhoon.unl.edu open 129.93.33.24 .De .PP Both of these try to open the machine called typhoon at the .IR "University of Nebraska" "." Using the symbolic name is the preferred way, because IP addresses may change without notice, while the symbolic names usually stay the same. .PP When you open a remote filesystem, you need to have permission. The .IR "FTP Protocol" "'s" authentication system is very similar to that of logging in to your account. You have to give an account name, and its password for access to that account's files. However, most remote systems that have anything you might be interested in don't require an account name for use. You can often get anonymous access to a remote filesystem and exchange files that have been made publicly accessible. The program attempts to get anonymous permission to a remote system by default. What actually happens is that the program tries to use ``anonymous'' as the account name, and when prompted for a password, uses your E-mail address as a courtesy to the remote system's maintainer. You can have the program try to use a specific account also. That will be explained later. .PP After the .I open command completes successfully, you are connected to the remote system and logged in. You should now see the command prompt change to reflect the name of the current remote directory. To see what's in the current remote directory, you can use the program's .IR "ls" " and " "dir" commands. The former is terse, preferring more remote files in less screen space, and the latter is more verbose, giving detailed information about each item in the directory. .PP You can use the program's .IR cd command to move to other directories on the remote system. The cd command behaves very much like the command of the same name in the .IR "Bourne" " and " "Korn" " shell." .PP The purpose of the program is to exchange data with other systems. You can use the program's .IR get command to copy a file from the remote system to your local system: .Ds get README.txt .De .PP The program will display the progress of the transfer on the screen, so you can tell how much needs to be done before the transfer finishes. When the transfer does finish, then you can enter more commands to the program's command shell. .PP You can use the program's .IR put command to copy a file from your system to the remote system: .Ds put something.tar .De .PP When you are finished using the remote system, you can open another one or use the .IR quit .PP Before quitting, you may want to save the current FTP session's settings for later. You can use the .IR bookmark command to save an entry into your $HOME/.ncftp/bookmarks file. When you use the .I bookmark command, you also specify a bookmark name, so the next time instead of opening the full hostname you can use the name of the bookmark. A bookmark acts just like one for your web browser, so it saves the remote directory you were in, the account name you used, etc., and other information it learned so that the next time you use the bookmark it should require as little effort from you as possible. .\"------- .SS "COMMAND REFERENCE" .\"------- .IP help The first command to know is .IR help "." If you just type .Xs help .Xe from the command shell, the program prints the names of all of the supported commands. From there, you can get specific help for a command by typing the command after, for example: .Xs help open .Xe prints information about the .I open command. .\"------- .IP ascii .\"------- This command sets the transfer type to ASCII text. This is useful for text-only transfers because the concept of text files differs between operating systems. For example on UNIX, a text file denotes line breaks with the linefeed character, while on MS-DOS a line break is denoted by both a carriage return character and a line feed character. Therefore, for data transfers that you consider the data as text you can use .I ascii to ensure that both the remote system and local system translate accordingly. The default transfer type that .I ncftp uses is not ASCII, but straight binary. .\"------- .IP "bgget and bgput" .\"------- These commands correspond to the .IR get " and " put commands explained below, except that they do the job in the background. Normally when you do a .I get then the program does the download immediately, and does not return control to you until the download completes. The background transfers are nice because you can continue browsing the remote filesystem and even open other systems. In fact, they are done by a daemon process, so even if you log off your UNIX host the daemon should still do your transfers. The daemon will also automatically continue to retry the transfers until they finish. To tell when background jobs have finished, you have to examine the .I $HOME/.ncftp/spool/log file, or run the .I jobs command from within .IR NcFTP "." .IP Both the .IR bgget " and " bgput commands allow you to schedule when to do the transfers. They take a ``\-@'' parameter, whose argument is a date of the form YYYYMMDDhhmmss (four digit year, month, day, hour, minute, second). For example, to schedule a download at 3 AM on November 6, you could try: .Xs bgget \-@ 19971106030000 /pub/idstuff/quake/q2_100\.zip .De .\"------- .IP bgstart .\"------- This command tells .I ncftp to immediately start the background transfers you've requested, which simply runs a copy of the .I ncftpbatch program which is responsible for the background jobs. Normally the program will start the background job as soon as you close the current site, open a new site, or quit the program. The reason for this is because since so many users still use slow dialup links that starting the transfers would slow things to a crawl, making it difficult to browse the remote system. An added bonus of starting the background job when you close the site is that .I ncftp can pass off that open connection to the .I ncftpbatch program. That is nice when the site is always busy, so that the background job doesn't have to wait and get re-logged on to do its job. .\"------- .IP binary .\"------- Sets the transfer type to raw binary, so that no translation is done on the data transferred. This is the default anyway, since most files are in binary. .\"------- .IP bookmark .\"------- Saves the current session settings for later use. This is useful to save the remote system and remote working directory so you can quickly resume where you left off some other time. The bookmark data is stored in your .I $HOME/.ncftp/bookmarks file. .\"------- .IP bookmarks .\"------- Lists the contents of your .I $HOME/.ncftp/bookmarks file in a human-readable format. You can use this command to recall the bookmark name of a previously saved bookmark, so that you can use the .I open command with it. .\"------- .IP cat .\"------- Acts like the ``/bin/cat'' .I UNIX command, only for remote files. This downloads the file you specify and dumps it directly to the screen. You will probably find the .I page command more useful, since that lets you view the file one screen at a time instead of printing the entire file at once. .\"------- .IP cd .\"------- Changes the working directory on the remote host. Use this command to move to different areas on the remote server. If you just opened a new site, you might be in the root directory. Perhaps there was a directory called ``/pub/news/comp\.sources\.d'' that someone told you about. From the root directory, you could: .Xs cd pub cd news cd comp.sources.d .Xe or, more concisely, .Xs cd /pub/news/comp.sources.d .Xe Then, commands such as .IR "get" ", " "put" ", and " "ls" could be used to refer to items in that directory. .IP Some shells in the .I UNIX environment have a feature I like, which is switching to the previous directory. Like those shells, you can do: .Xs cd - .Xe to change to the last directory you were in. .\"------- .IP chmod .\"------- Acts like the ``/bin/chmod'' .I UNIX command, only for remote files. However, this is not a standard command, so remote FTP servers may not support it. .\"------- .IP close .\"------- Disconnects you from the remote server. The program does this for you automatically when needed, so you can simply open other sites or quit the program without worrying about closing the connection by hand. .\"------- .IP debug .\"------- This command is mostly for internal testing. You could type .Xs debug 1 .Xe to turn debugging mode on. Then you could see all messages between the program and the remote server, and things that are only printed in debugging mode. However, this information is also available in the .I $HOME/.ncftp/trace file, which is created each time you run .IR ncftp "." If you need to report a bug, send a .I trace file if you can. .\"------- .IP dir .\"------- Prints a detailed directory listing. It tries to behave like .IR UNIX "'s" ``/bin/ls -l'' command. If the remote server seems to be a .I UNIX host, you can also use the same flags you would with .IR "ls" ", for instance" .Xs dir -rt .Xe would try to act like .Xs /bin/ls -lrt .Xe would on .IR UNIX "." .\"------- .IP edit .\"------- Downloads into a temporary file for editing on the local host, then uploads the changed file back to the remote host. .\"------- .IP get .\"------- Copies files from the current working directory on the remote host to your machine's current working directory. To place a copy of ``README'' and ``README.too'' in your local directory, you could try: .Xs get README README.too .Xe You could also accomplish that by using a wildcard expression, such as: .Xs get README* .Xe This command is similar to the behavior of other FTP programs' .I mget command. To retrieve a remote file but give it a different name on your host, you can use the ``\-z'' flag. This example shows how to download a file called .I ReadMe.txt but name it locally as .IR README ":" .Xs get -z ReadMe.txt README .Xe The program tries to ``resume'' downloads by default. This means that if the remote FTP server lost the connection and was only able to send 490 kilobytes of a 500 kilobyte file, you could reconnect to the FTP server and do another .I get on the same file name and it would get the last 10 kilobytes, instead of retrieving the entire file again. There are some occasions where you may not want that behavior. To turn it off you can use the ``\-f'' flag. .IP There are also times where you want to append to an existing file. You can do this by using the ``\-A'' flag, for example .Xs get -A log.11 .Xe would append to a file named ``log\.11'' if it existed locally. .IP Another thing you can do is delete a remote file after you download it. This can be useful when a remote host expects a file to be removed when it has been retrieved. Use the double\-D flag, such as ``get\ \-DD'' to do this. .IP The .I get command lets you retrieve entire directory trees, too. Although it may not work with some remote systems, you can try ``get\ \-R'' with a directory to download the directory and its contents. .IP When using the ``\-R'' flag, you can also use the ``\-T'' flag to disable automatic on-the-fly TAR mode for downloading whole directory trees. The program uses TAR whenever possible since this usually preserves symbolic links and file permissions. TAR mode can also result in faster transfers for directories containing many small files, since a single data connection can be used rather than an FTP data connection for each small file. The downside to using TAR is that it forces downloading of the whole directory, 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. .\"------- .IP jobs .\"------- Views the list of currently executing .I NcFTP background tasks. This actually just runs .I ncftpbatch \-l for you. .\"------- .IP lcd .\"------- The .I lcd command is the first of a few ``l'' commands that work with the local host. This changes the current working directory on the local host. If you want to download files into a different local directory, you could use .I lcd to change to that directory and then do your downloads. .\"------- .IP lchmod .\"------- Runs ``/bin/chmod'' on the local host. .\"------- .IP lls .\"------- Another local command that comes in handy is the .I lls command, which runs ``/bin/ls'' on the local host and displays the results in the program's window. You can use the same flags with .I lls as you would in your command shell, so you can do things like: .Xs lcd ~/doc lls -lrt p*.txt .De .\"------- .IP lmkdir .\"------- Runs ``/bin/mkdir'' on the local host. .\"------- .IP lookup .\"------- The program also has a built-in interface to the name service via the .I lookup command. This means you can lookup entries for remote hosts, like: .Xs lookup cse.unl.edu ftp.cs.unl.edu sphygmomanometer.unl.edu .Xe prints: .Xs cse\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.1 typhoon\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.24 sphygmomanometer\.unl\.edu\ \ 129\.93\.33\.126 .Xe There is also a more detailed option, enabled with ``\-v,'' i.e.: .Xs lookup -v cse.unl.edu ftp.cs.unl.edu .Xe prints: .Xs cse.unl.edu: \ \ \ \ Name:\ \ \ \ \ cse\.unl.edu \ \ \ \ Address:\ \ 129\.93.33.1 ftp\.cs.unl.edu: \ \ \ \ Name:\ \ \ \ \ typhoon\.unl.edu \ \ \ \ Alias:\ \ \ \ ftp\.cs.unl.edu \ \ \ \ Address:\ \ 129\.93.33.24 .Xe You can also give .I IP addresses, so this would work too: .Xs lookup 129.93.33.24 .Xe prints: .Xs typhoon\.unl\.edu\ \ \ \ \ \ \ \ \ \ \ 129\.93\.33\.24 .De .\"------- .IP lpage .\"------- Views a local file one page at a time, with your preferred $PAGER program. .\"------- .IP lpwd .\"------- Prints the current local directory. Use this command when you forget where you are on your local machine. .\"------- .IP lrename .\"------- Runs ``/bin/mv'' on the local host. .\"------- .IP lrm .\"------- Runs ``/bin/rm'' on the local host. .\"------- .IP lrmdir .\"------- Runs ``/bin/rmdir'' on the local host. .\"------- .IP ls .\"------- Prints a directory listing from the remote system. It tries to behave like .IR UNIX "'s" ``/bin/ls\ \-CF'' command. If the remote server seems to be a .I UNIX host, you can also use the same flags you would with .IR "ls" ", for instance" .Xs ls -rt .Xe would try to act like .Xs /bin/ls -CFrt .Xe would on .IR UNIX "." .IP .I ncftp has a powerful built-in system for dealing with directory listings. It tries to cache each one, so if you list the same directory, odds are it will display instantly. Behind the scenes, .I ncftp always tries a long listing, and then reformats it as it needs to. So even if your first listing of a directory was a regular ``ls'' which displayed the files in columns, your next listing could be ``ls\ \-lrt'' and .I ncftp would still use the cached directory listing to quickly display the information for you! .\"------- .IP mkdir .\"------- Creates a new directory on the remote host. For many public archives, you won't have the proper access permissions to do that. .\"------- .IP open .\"------- Establishes an FTP control connection to a remote host. By default, .I ncftp logs in anonymously to the remote host. You may want to use a specific user account when you log in, so you can use the ``\-u'' flag to specify which user. This example shows how to .I open the host ``bowser\.nintendo\.co\.jp'' using the username ``mario:'' .Xs open -u mario bowser.nintendo.co.jp .De .IP Here is a list of options available for use with the .I open command: .IP .BI "-u " "XX" Use username .I XX instead of anonymous. .IP .BI "-p " "XX" Use password .I XX with the username. .IP .BI "-j " "XX" Use account .I XX in supplement to the username and password (deprecated). .IP .BI "-P " "XX" Use port number .I XX instead of the default FTP service port (21). .\"------- .IP page .\"------- Browses a remote file one page at a time, using your $PAGER program. This is useful for reading README's on the remote host without downloading them first. .\"------- .IP "pdir and pls" .\"------- These commands are equivalent to .IR "dir" " and " "ls" respectively, only they feed their output to your pager. These commands are useful if the directory listing scrolls off your screen. .\"------- .IP put .\"------- Copies files from the local host to the remote machine's current working directory. To place a copy of ``xx.zip'' and ``yy.zip'' in the remote directory, you could try: .Xs put xx.zip yy.zip .Xe You could also accomplish that by using a wildcard expression, such as: .Xs put *.zip .Xe This command is similar to the behavior of other FTP programs' .I mput command. To send a remote file but give it a different name on your host, you can use the ``\-z'' flag. This example shows how to upload a file called ``ncftpd\-2\.0\.6\.tar\.gz'' but name it remotely as ``NFTPD206\.TGZ:'' .Xs put -z ncftpd-2.0.6.tar.gz NFTPD206.TGZ .Xe The program .I does not try to ``resume'' uploads by default. If you do want to resume an upload, use the ``\-z'' flag. .IP There are also times where you want to append to an existing remote file. You can do this by using the ``\-A'' flag, for example .Xs put -A log11.txt .Xe would append to a file named ``log11\.txt'' if it existed on the remote server. .IP Another thing you can do is delete a local file after you upload it. Use the double\-D flag, such as ``put\ \-DD'' to do this. .IP The .I put command lets you send entire directory trees, too. It should work on all remote systems, so you can try ``put\ \-R'' with a directory to upload the directory and its contents. .\"------- .IP pwd .\"------- Prints the current remote working directory. A portion of the pathname is also displayed in the shell's prompt. .\"------- .IP quit .\"------- Of course, when you finish using the program, type .I quit to end the program (You could also use .IR "bye" ", " "exit" ", or " "^D" ")." .\"------- .IP quote .\"------- This can be used to send a direct .I FTP Protocol command to the remote server. Generally this isn't too useful to the average user. .\"------- .IP rename .\"------- If you need to change the name of a remote file, you can use the .I rename command, like: .Xs rename SPHYGMTR.TAR sphygmomanometer-2.3.1.tar .De .\"------- .IP rhelp .\"------- Sends a help request to the remote server. The list of .I FTP Protocol commands is often printed, and sometimes some other information that is actually useful, like how to reach the site administrator. .IP Depending on the remote server, you may be able to give a parameter to the server also, like: .Xs rhelp NLST .Xe One server responded: .Xs Syntax: NLST [ path-name ] .De .\"------- .IP rm .\"------- If you need to delete a remote file you can try the .I rm command. Much of the time this won't work because you won't have the proper access permissions. This command doesn't accept any flags, so you can't nuke a whole tree by using ``\-rf'' flags like you can on .IR UNIX "." .\"------- .IP rmdir .\"------- Similarly, the .I rmdir command removes a directory. Depending on the remote server, you may be able to remove a non-empty directory, so be careful. .\"------- .IP set .\"------- This lets you configure some program variables, which are saved between runs in the .I $HOME/.ncftp/prefs file. The basic syntax is: .Xs set