LinuxCommandLibrary

esearch

Search for entities in ebuild repositories

TLDR

Search the pubmed database for selective serotonin reuptake inhibitor

$ esearch -db pubmed -query "[selective serotonin reuptake inhibitor]"
copy

Search the protein database using a query and regex
$ esearch -db [protein] -query ['Escherichia*']
copy

Search the nucleotide database for sequences whose metadata contain insulin and rodents
$ esearch -db nuccore -query "[insulin [PROT] AND rodents [ORGN]]"
copy

Display help
$ esearch [[-h|-help]]
copy

SYNOPSIS

esearch [options] search_term

PARAMETERS

-N, --name
    Search only package names.

-D, --description
    Search only package descriptions (aka summaries).

-F, --full
    Search names, descriptions, homepages, maintainers, keywords, licenses, and slots. This is the default search scope.

-C, --category
    Search only package categories.

-K, --keyword
    Search package keywords (e.g., '~amd64', 'stable').

-L, --license
    Search package licenses (e.g., 'GPL-2').

-H, --homepage
    Search package homepages.

-i, --installed
    Show only packages currently installed on the system.

-a, --available
    Show only packages available in the repository but not installed.

-A, --all
    Show both installed and available packages (default if no other status filter is specified).

-u, --unmask
    Show packages that are currently unmasked.

-m, --masked
    Show packages that are currently masked.

-t, --stable
    Show packages marked as stable for the current architecture.

-T, --unstable
    Show packages marked as unstable (testing) for the current architecture.

-e, --exact
    Perform an exact match search. Disables globbing and regular expressions.

-r, --regexp
    Interpret the search term as a regular expression.

-g, --glob
    Interpret the search term using globbing (wildcards like '*' and '?'). This is the default behavior if no other match type is specified.

-c, --compact
    Display output in a more compact format.

--color
    Force colored output (default is automatic).

--no-color
    Disable colored output.

DESCRIPTION

esearch is a powerful command-line utility for quickly searching packages and their metadata within the Gentoo Linux Portage system. It's a fundamental tool for Gentoo users to discover, identify, and manage software.

Unlike emerge --search, esearch is designed for speed and flexibility, offering a wide array of options to narrow down searches by package name, description, homepage, maintainer, keywords, licenses, and more. It queries the local ebuild tree, providing instant results without requiring network access for basic searches (though the ebuild tree itself needs to be updated periodically via emerge --sync or eix-sync).

esearch is part of the portage-utils collection, which provides several supplementary tools to enhance the Portage experience. It's an indispensable command for navigating the vast Gentoo repository.

CAVEATS

esearch is specific to Gentoo Linux and relies on the local Portage ebuild tree. Its functionality is tied to the existence and up-to-dateness of this tree. If the ebuild tree is not synchronized regularly (e.g., via emerge --sync or eix-sync), esearch results might be outdated or incomplete. It does not perform live network queries.

SEARCH SCOPE AND MATCHING

By default, esearch performs a 'full' search, looking for the search term across package names, descriptions, homepages, maintainers, keywords, and licenses. Users can refine this by using options like -N (name only) or -D (description only). Matching can be controlled via -g (glob, default), -r (regexp), or -e (exact match).

OUTPUT FORMATTING

esearch provides options to control the output format. The -c or --compact option presents results in a more condensed line format, which is useful for scripting or when a brief overview is needed. Colored output can be explicitly enabled or disabled using --color and --no-color, respectively.

HISTORY

esearch was developed as part of the portage-utils project, aiming to provide faster and more versatile package search capabilities than the built-in emerge --search command. It emerged to address performance limitations and offer more granular control over search criteria, becoming a staple utility for Gentoo users to efficiently browse their package repository.

SEE ALSO

emerge(1), portage(5), eix(1), ebuild(5)

Copied to clipboard