Reference

qftp(1)

file transfer program

NAME

qftp - file transfer program

SYNOPSIS

qftp [options] [-u user[:password]] [-y retries[:sleep]] [host[:][dir][file]]

DESCRIPTION

qftp is a ftp program which aims to be small and efficient but still powerful and have lots of features. It's still under active development and will improve by time (see the NOTES section below). The interface is somewhat similar to other line oriented ftp clients, you type commands and get response from the server. But it tries to minimize the neccessary typing and speed up usage.

Some features:

The directory listings from ls and dir are cached (they will only be transferred once per session).

Single key shortcuts for all commands.

CD is the default command (ie: you can type a directory name directly at the prompt, without c or cd and it will be parsed as cd <dir>).

Background downloading with get -b

The view command can optionally decompress files on the fly.

Automatic retry on login (open -y 10:5 <host> will retry ten times and sleep five seconds between)

You can specify aliases and default username, password and directory in a .qftprc file in you homedirectory (see FILES section below)

Marking of files (tagging) for later retrieval in a big chunk.

Automatic anonymous login (open -a)

The listed files and directories are numbered, and you can use the numbers instead of the filename. See the EXAMPLES section for further description.

Commands

All commands have an single letter shortcuts, and you need only to type enough letters to distinguish between the commands.

ie: G, getm and getmarked are all the same command, this is for saving unneccessary typing.

There is only one set of options, and each command uses a subset of them, se below for a description of the options. You can use the set command to set an option globally (set -b will put all downloads in the background).

o - open [options] [host][:][dir][file]

Opens a connection to host. It can retry a number of times and sleep a specified time between (the -y option).

It takes login information from the following places:
The -a option (anonymous login)
The -u option (specified user and password)
The .netrc file (except if you provide the -n switch)
and at last, it will ask you.

It will change to a directory either if you specify one or if it finds the hosts in the .qftprc file. If you specify a file will it retrieve it.

x - close

Closes the connection.

l - ls [options] [path]

Lists the files in path, or in the current directory if you omit the path.

If you provide the -l switch you will get a "long" list, with permission, user, group, size, date and name (Like a normal ls -l). It's normally sorted by name, -r reverses it. -s sorts by size.

Each line begins with a number, you can use this number as a shortcut for the filename (g #42 instead of get this_is_a_very_long_filename)

If the q (quiet) option is unset will ls wait for <enter> after a screenfull of lines, and the short ls will print multiple columns.

The listings are cached.

d - dir [options] [path]

Like ls -l

c - cd [path]

Changes remote working directory to path.

C - lcd [path]

Changes local working directory to path.

m - mark [options] [path]

Marks a file or directory for later retrieval. Useful if you're on a slow link and don't want to wait for every file before you can continue browsing the site.

G - getmarked [options]

Retrieves the files you have marked. It takes the same options as get.

Q - quote [ftp-command]

Sends and arbitrary command to the server and shows the result.

Use quote HELP to get help from the server with the commands.

g - get [options] [paths...]

Retrieves one or more files or directories.

Available options:

-b forks(2) and opens a new connection and retrieves the file in the background.

-e retrieves whole directory structures (it doesn't handle links yet)

-f forces overwrite of local files.

-c continues downloading of an existing file (aka reget)

p - put [file]

Uploads files to the remote site. Doesn't handle any options yet.

h - help

Shows a summary over available commands and options.

s - set [option [argument]]

Set an option or shows the values of all options if invoked without option.

v - view [options]

Views a file using $PAGER (or "more" if $PAGER is unset). Can optionally (-z option) decompress files on the fly (using gzip, make sure it's in your path).

Options

Most options can be invoked either in lowercase or uppercase. Lowercase to set or enable and uppercase to unset or disable.

-a anonymous login

-b Background operation

-c Continuation mode (reget)

-e Recursive get

-f Force overwrite

-l Long Listings

-n Don't use username and password from .netrc

-q Quiet operation

-r Reverse listings

-s Sort by size

-t Sort by time (doesn't work yet)

-u Set default user and password, the password is optional and is separated from the username with a ":"

-y Set number of retries and optionally the sleeping time between, separated by a ":"

-z Decompress files on the fly before viewing.

OPTIONS

The command line options are the same as for the different command (see above), they are set globally (as if set by the set command).

EXAMPLES

Invocation examples:

Log in anonymously at sunsite and cd to /pub/Linux

qftp -a sunsite.unc.edu/pub/Linux/

Get a kernel, retry 10 times and sleep 60 seconds between.

qftp -a -y 10:60 ftp.kernel.org:/pub/linux/kernel/v2.1/linux-2.1.104.tar.gz

Log in with a username and try 30 times

qftp -u user -y 30 some.host.net

Get a whole directory:

qftp -e -a sunsite.unc.edu/pub/Linux/Incoming/

Command examples

foo:/home/bar% get #10 #12-20,45
Will get the files with number 10, 12 to 20 and 45 in the previous listing.

foo:/home/bar% v README.gz
Will get README.gz, decompress it with gzip and feed the result into $PAGER.

foo:/home/bar% g -rf tmp #10
Gets tmp and file/dir number 10, recurses into subdirectories and forces overwrite.

foo:/home/bar% s -u peter
Sets default user name to "peter".

foo:/home/bar% ls -ls
Long listing sorted by size, smallest first.

ENVIRONMENT

HOME

Used to find the .qftprc file

LOGNAME

Used for the password for anonyomus sessions.

PAGER

Used with the view command.

FILES

~/.qftprc
It has the following format:

Lines started with - are parsed as global options. Other lines defines aliases. Username, password and directory are optional.

Example:

-c
-y 100:10
sunsite sunsite.unc.edu ftp [email protected] /pub/Linux
kernel ftp.kernel.org - - -
home your.home.net name xxxx -

NOTES

This program is under active development, please contact me (Peter Strand, <[email protected]>) if you find bugs or have ideas of improvements. Everything which speeds up usage or makes it more convenient to use is welcome.

CAVEATS

As I said before, it is under development and contains probably some bugs. Please report what you find.

AUTHOR

Peter Strand <[email protected]>

History