*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->FreeBSD man pages -> fetch (1)              
Title
Content
Arch
Section
 

FETCH(1)

Contents


NAME    [Toc]    [Back]

     fetch -- retrieve a file by Uniform Resource Locator

SYNOPSIS    [Toc]    [Back]

     fetch [-146AFMPRUadlmnpqrsv] [-B bytes] [-S bytes] [-T seconds] [-N file]
           [-o file] [-w seconds] [-h host] [-c dir] [-f file] [URL ...]

DESCRIPTION    [Toc]    [Back]

     The fetch utility provides a command-line interface to the fetch(3)
     library.  Its purpose is to retrieve the file(s) pointed to by the URL(s)
     on the command line.

     The following options are available:

     -1          Stop and return exit code 0 at the first successfully
                 retrieved file.

     -4          Forces fetch to use IPv4 addresses only.

     -6          Forces fetch to use IPv6 addresses only.

     -A          Do not automatically follow ``temporary'' (302) redirects.
                 Some broken Web sites will return a redirect instead of a
                 not-found error when the requested object does not exist.

     -a          Automatically retry the transfer upon soft failures.

     -B bytes    Specify the read buffer size in bytes.  The default is 4096
                 bytes.  Attempts to set a buffer size lower than this will be
                 silently ignored.  The number of reads actually performed is
                 reported at verbosity level two or higher (see the -v flag).

     -c dir      The file to retrieve is in directory dir on the remote host.
                 This option is deprecated and is provided for backward compatibility
 only.

     -d          Use a direct connection even if a proxy is configured.

     -F          In combination with the -r flag, forces a restart even if the
                 local and remote files have different modification times.
                 Implies -R.

     -f file     The file to retrieve is named file on the remote host.  This
                 option is deprecated and is provided for backward compatibility
 only.

     -h host     The file to retrieve is located on the host host.  This
                 option is deprecated and is provided for backward compatibility
 only.

     -l          If the target is a file-scheme URL, make a symbolic link to
                 the target rather than trying to copy it.

     -M

     -m          Mirror mode: if the file already exists locally and has the
                 same size and modification time as the remote file, it will
                 not be fetched.  Note that the -m and -r flags are mutually
                 exclusive.

     -N file     Use file instead of ~/.netrc to look up login names and passwords
 for FTP sites.  See ftp(1) for a description of the
                 file format.  This feature is experimental.

     -n          Don't preserve the modification time of the transferred file.

     -o file     Set the output file name to file.  By default, a ``pathname''
                 is extracted from the specified URI, and its basename is used
                 as the name of the output file.  A file argument of `-' indicates
 that results are to be directed to the standard output.

     -P

     -p          Use passive FTP.  This is useful if you are behind a firewall
                 which blocks incoming connections.  Try this flag if fetch
                 seems to hang when retrieving FTP URLs.

     -q          Quiet mode.

     -R          The output files are precious, and should not be deleted
                 under any circumstances, even if the transfer failed or was
                 incomplete.

     -r          Restart a previously interrupted transfer.  Note that the -m
                 and -r flags are mutually exclusive.

     -S bytes    Require the file size reported by the server to match the
                 specified value.  If it does not, a message is printed and
                 the file is not fetched.  If the server does not support
                 reporting file sizes, this option is ignored and the file is
                 fetched unconditionally.

     -s          Print the size in bytes of each requested file, without
                 fetching it.

     -T seconds  Set timeout value to seconds.  Overrides the environment
                 variables FTP_TIMEOUT for FTP transfers or HTTP_TIMEOUT for
                 HTTP transfers if set.

     -U          When using passive FTP, allocate the port for the data connection
 from the low (default) port range.  See ip(4) for
                 details on how to specify which port range this corresponds
                 to.

     -v          Increase verbosity level.

     -w seconds  When the -a flag is specified, wait this many seconds between
                 successive retries.

     If fetch receives a SIGINFO signal (see the status argument for stty(1)),
     the current transfer rate statistics will be written to the standard
     error output, in the same format as the standard completion message.

DIAGNOSTICS    [Toc]    [Back]

     The fetch command returns zero on success, or one on failure.  If multiple
 URLs are listed on the command line, fetch will attempt to retrieve
     them each of them in turn, and return zero only if they were all successfully
 retrieved.

ENVIRONMENT    [Toc]    [Back]

     FTP_TIMEOUT   maximum time, in seconds, to wait before aborting an FTP
                   connection.

     HTTP_TIMEOUT  maximum time, in seconds, to wait before aborting an HTTP
                   connection.

     All environment variables mentioned in the documentation for the fetch(3)
     library are supported.

SEE ALSO    [Toc]    [Back]

      
      
     fetch(3)

HISTORY    [Toc]    [Back]

     The fetch command appeared in FreeBSD 2.1.5.  This implementation first
     appeared in FreeBSD 4.1.

AUTHORS    [Toc]    [Back]

     The original implementation of fetch was done by Jean-Marc Zucconi.  It
     was extensively re-worked for FreeBSD 2.2 by Garrett Wollman, and later
     completely rewritten to use the fetch(3) library by Dag-Erling Smorgrav.

NOTES    [Toc]    [Back]

     The -b and -t options are no longer supported and will generate warnings.
     They were workarounds for bugs in other OSes which this implementation
     does not trigger.

     One cannot both use the -h, -c and -f options and specify URLs on the
     command line.


FreeBSD 5.2.1                   March 11, 2003                   FreeBSD 5.2.1
[ Back ]
 Similar pages
Name OS Title
uri Linux uniform resource identifier (URI), including a URL or URN
DtMmdbLocatorGetSectionLoc HP-UX obtains the locator of a section
DtMmdbSectionGetLoc HP-UX obtains a section's locator
DtMmdbBookGetTocObjectId HP-UX obtains the locator of a book's TOC section
DtMmdbSectionGetTocLoc HP-UX obtains the locator for a book's TOC section
AFidentifyfd IRIX retrieve the audio file format of a file descriptor / open AFfilehandle
numa IRIX non uniform memory access
rad_get_cpus Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_max Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
rad_get_info Tru64 Query resource complements of a Resource Affinity Domain (libnuma)
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service