swim - chapter 11
SEARCHING

usage: swim --search ? (--research || --refinesearch) <pattern(s)>
       swim --powersearch ? (--research || --refinesearch) <pattern(s)> 
       swim --ps ? (--research || --refinesearch) <pattern(s)> 

options: [-g] [-n] [--dbpath <dir>] [--root <dir>] [--no]
         [--arch <architecture>] [--dists <distribution>
         [--ftp ? --source | --source_only <[--diff]>] 
         [-xyrz --remove ? <[--nz]>] [--stdin] [--apt2df]
         [--no] [--df2apt] [--purge] [<\d{1,}>]
 
         [--dir] and no [-g]for --powersearch or --ps


11.1 OVERVIEW

swim provides two major types of searches. A search with --search searches package information (see FORMAT , section 9.5), and a search with --powersearch or --ps searches package information, and all files and/or directories associated with each package.

The results of either of these searches can be narrowed down by running a test search with --research (this step can be skipped) and/or setting the results in stone with --refinesearch. --search can be narrowed down initially by specifying a particular group, and --powersearch can be expanded initially by specifying that directories be searched as well as files. Both searches can use the same virtual options which the major mode -q or --query use. Generally, it is preferable to run a search, and then to provide the results of a search (using -S) as an argument to -q or --query; this allows the results of a search to be queried. Every time a search is run the results are appended to the history, past searches can be refined or researched by providing the numerical argument pertaining to the history. \d{1,} is simply Perl notation meaning a number with one of more digits.

Perl regexps (see perlre(1p)) can be used to define the pattern (string) provided as an argument to a search. Do not surround a pattern in slashes, a slash is only used after all patterns and before the modifiers i and/or m (swim supports these two modifiers). To search for more than one pattern, patterns are separated with bars (|). Patterns may include quatifiers, and metacharacters, also found in egrep(1).

If a search finds any packages which match the search, the package information will be displayed as the package is found. The package will only be shown once regardless of how many times it is found while the search progresses. When the search is over the number of packages found is shown.

--search provides a search of package information. This is similiar to grepping ``swim -qait'' or ``swim -qaint'', but it is significantly faster. A search can be performed on a particular group by using -g with a group as an argument

--powersearch is somewhat similiar to ``dpkg --search'' which searches all files and directories on an installed system, but it combines --search with the file and/or directory search, and can also be performed on a not-installed system. A powersearch is significantly faster than the search which dpkg provides (even more so when ``swim --ramdiskon --searchfile'' is used) and even more importantly provides a logical output of the search (like ``swim -qi packagename''). By default a search of all directories is not performed because usually this is redundant except in rare cases. To enable a search of all directories use the --dir option.


11.2 NARROWING A PREVIOUS SEARCH

--research allows the results of a previous search to be researched without making the new results permanent.

--refinesearch allows the results of a previous search to be researched while making the new results permanent.

\d{1,} is a numerical argument to refine or research a past search from the history.


11.3 MINOR MODES

-n allows the not-installed databases to be searched. These databases will not exist if the not-installed databases were made with the FDB argument (see --initndb).

-g (see -g above and MINOR MODES , section 9.1).


11.4 OTHER OPTIONS

--no prevents normal output from a search, but does show how many packages were found.

See the section ``SPECIFYING THE DATABASES TO USE , section 9.2'' for options --arch, -dists.

See the section ``FTP - VIRTUAL OPTIONS , section 9.6'' for --ftp, --source, --source_only, --diff,

See the section ``APT - VIRTUAL OPTIONS , section 9.7'' for -xyz, --nz, --stdin,

See the section ``REMOVING AN INSTALLED PACKAGE - VIRTUAL OPTIONS , section 9.8'' for --purge, --remove, -r.

See the section ``DATABASE LOCATIONS , section 9.11'' for options --dbpath and --root.


11.5 EXAMPLES

swim -gn hamradio --search "radio network/i" --dbpath /test --arch alpha

will search the alpha architecture not-installed system databases in the /test directory for all package information from the hamradio group using the case insensitive pattern ``radio network''.

swim --powersearch dpkg -xn

will search the not-installed system databases for all package information and all files using the case sensitive pattern dpkg, after which apt-get will run a simulation of what would happen if it got and installed these packages.


swim - Copyright © 1999 Jonathan D. Rosenbaum
Contents; next; back.
15 June 1999
Jonathan D. Rosenbaummttrader@access.mountain.net