uftp(1)

Name
uftp - universal file transfer program

Syntax
uftp

uftp alias_name [args_for_alias]

uftp hostname

Description
The uftp is user interactive and non-interactive program to the ARPANET File Transfer Protocol (RFC959). The uftp allows user to transfer files, group of files in foreground and background modes. uftp runs on the client host.

Basic features
Auto retrying of connection to remote node until it is succeeded.

Automatic reconnection with continue to transfer if the connection was broken.

Several sessions (frames) at once. Dynamically switching between them.

Setup commands, which are executed after "open" and "cd" commands. (aliases autologin & autocd )

Cleaning timeout on the remote server.

The user can setup any system parameters, like timeouts, reconnect delays, default port number, automatic binary mode, automatic "hash" mode and interval to clean timeouts on FTP server.

User can setup the prompt with the descriptions of local and remote directories, full or short site name, time, frame number, remote user's name, port number, timeout, process identification.

Several commands in one line.

Aliases with arguments, which may contain few commands separated by ';'.

Redirection input/output irrespective of context or/and command.

The local files are libftp-files, which split on local files, pipes and ftp-files. This particular file specification can be used in any context, including for file names of redirection input/output streams.

Any command may be executed in background mode, though the current frame is not droped out and user can continue his work.

Creation of alias described the current frame, and save all exist aliases to personal automatic startup file, which is differ from startup file. This file user can make himself.

Environment description
Command line mode supports all edit key bindings. (uftp using readline library). Before each command user can see the prompt with description of current frame. If debug mode is enabled user see the protocol between uftp and ftp-daemon (ftpd).

Commands

connect
    [host-name] Connect to remote site.

open
    [host-name] [user-name] [password] [directory] Makes connection to remote site, sent login, password and change directory. If the "try" option is set an attempt to connect will be forced until success.

ftp [hostname] [directory] Anonymous connection to ftp-site.

reopen
    Reopen broken frame.

close
    Close the current connection.

quit
    Quit from uftp (You can press Contol-D)

list
    Description list of all frames.

user
    [user-name] [password] Send user's name to site, automatically require password if needed.

pass
    [password] Specify user's password.

bin Set binary transfer mode.

ascii
    Set ASCII transfer mode.

cd  directory_name Change the current directory on remote site.

acd [directory_name] Archie searching by specified pattern with subsequent connection to desired point. Maximum number of possible points is 20. Afterwards user can select any point. If user don't specify "directory_name", last search buffer is displayed for selection, if this buffer is not empty.

lcd directory_name Local change directory. User can use metacharacters.

abort
    Abort execute of last procedure with server. Warning: this procedure sometimes is not correctly working.

mkdir
    directory_name Create new directory on the server.

rm  filename_or_pattern Remove specified file(s) on the server.

mv  old_filename new_filename Move file on the server.

dir [keys] [filename_spec] .... Make long list of specified file(s) with date, size, etc...

ls  [keys] [filename_spec] .... Make short list of specified file(s).

get remote_filename [local_filename_or_directory] Receive the file from the server to local file system (only one file!). If option "rest" is turn on then transfer starts from the end of local file.

mget
    [remote_filename] [local_directory] Receive many files from the server to local file system.

reget
    remote_filename [local_filename_or_directory]. The same as get, but the option "rest" is ignored.

aget
    [pattern_for_archie] Getting the file, which need to find via archie service. See also "acd" description.

bget
    [libftp_file] [local_file] Get file specified as libftp-file. See libftp file specification. Operation proceedes until success.

put local_filename [remote_filename] Put one file to server.

mput
    local_filename(s) Put specified file(s) to server.

reput
    The same as put, but the option "rest" is ignored.

bput
    [[local_file] libftp_file] Put file specified as libftp-file. See libftp file specification. Operation proceedes until success.

copy
    [frame/]filename [frame/]filename Copy one file from first frame to second. If the frame number is not specified then use current frame number. Transfer operation executes via libftp cache.

ccopy
    [frame/]filename [frame/]filename Copy one file from first frame to second. If the frame number is not specified then used current frame number. Transfer operation executes via leased line between two servers cache.

cat filename Display context of specified file on screen.

page
    The same as cat, but with using of pager. Name of pager specified in environment variable PAGER or "more" by default.

bg  any_command any_command & Run any command in background mode. Default output is redirected to /tmp/uftp-<user_name>.XXXXXX file.

archie
    [pattern] Archie search. In case if argument are omitted, reprint last search.

dup Create new frame as current.

quote
    Send raw command to server. If option "glassmode" is set then all non-recognized commands send to server as raw also.

help
    [command] Print brief help or help for specified command.

alias
    alias_name alias_string Makes new alias, if the alias string uftp contains string like $1, $2, $* then it will be replaced by argument to alias. If this sequences in alias is not found, then all existing alias's arguments will append to end of alias call string. User can insert to alias string like \> \< for future redirect input/output. Quotes ' and " can be used also.

unalias
    alias_name Remove specified alias.

mkalias
    alias_name Makes new alias, which user can use in future for login to this point again. See also "savealias"

savealias
    Save all aliases in startup file.

Libftp file specification
All local files interpret as libftp's files. Libftp responds to three types of files such
 as local file, ftp files and program pipes. All files can be described as next syntax:
   |string - interprets string as shell command, which must be executed with appropriate input/output for file. It depends where
   this file is specified.
   hostname:filename - interprets as file, which must be taken
   using ftp protocol with anonymous access
   user@hostname:filename - interprets as file accesses via ftp
   with password yourname@your_host.your_domain
   user/pass@hostname:filename - also ftp file.
   *STDIN*, *STDOUT*, *STDERR* or char '-' - opened streams.
   anything - local file name.

String syntax
The strings starting from char '!' interpret as shell command. The strings or aliases containing one or few char ';' will be executed as a chain commands. The chains of characters between " or ' interpret as one set without syntax resolving. In any command string user can redirect input or/and output using char > and < . For the complex file name it must quoted by ' or ". Examples:
    dir >filename
    cat filename >'|mail -s "my files" fiend@hostname.domain'
    dir -R etc bin >"|gzip >result.gz"
    cat filename > user/password@hostname:/dir/filename.ext
    put - < "|finger @hostname" newfile.finger

Options (command set)

set Show all current settings.

set frame <frame_number> Switch to another frame. You can also switch by insert on frame number to the begin of command line.

set timeout <seconds> Set timeout for send/receive operations.

set noop <secs> Set interval for send NOOP command to each connected server for cleaning timeouts.

set nooptimeout <seconds> Set timeout for NOOP operation.

set sleep <secs> Set pause interval between transfer attempts.

set debug <y|n> Enable or disable protocol debug output

set try <y|n> Enable or disable retrys after lost peer.

set hash <y|n> Enable or disable trace for the transfer operations.

set restore <y|n> Enable or disable default transfer starting from end of file.

set bin <y|n> Automatic binary mode.

set glass <y|n> This command only to debug the protocol. After glassmode it is enable to send raw to server of all unresponded commands.

set prompt <prompt_string> Set the prompt. Prompt is a string, which may contain %<char> or ^<char> combitanions with the next embodies:
                   %H, %h - full and short remote host names
                   %M, %m - full and short local host names
                   %u - remote user's name
                   %d - remote current directory
                   %D - local current directory
                   %f - number of current frame
                   %p - the ftp's port number
                   %t - timeout
                   %T - current time
                   %P - uftp process id
                   %% - character %
                   ^<char>- control character
                   %^ - character ^

set port <number> Set default FTP's port for next sessions.

set user <user_name> Set default user's name.

Startup file
User can modify his startup file created automatically. This file may contain some uftp's commands separated by new-line. The name of this file is ~/.uftprc. The file ~/.uftp_aliases is created automatically by uftp's command "savealias", so it is not needed to edit handly.

Author of uftp and libftp
  Oleg Orel
  Department of Electronics and automatisation.
  Institute for High Energy Physics
  Protvino, Russia
  E-mail: orel@oea.ihep.su, orel@dxcern.cern.ch

See also
 ncftp (1), ftp (1), ftpd (8)