LinuxCommandLibrary

elink

Create hard links between files

TLDR

Search pubmed then find related sequences

$ esearch -db pubmed -query "[selective serotonin reuptake inhibitor]" | elink -target nuccore
copy

Search nucleotide then find related biosamples
$ esearch -db nuccore -query "[insulin [PROT] AND rodents [ORGN]]" | elink -target biosample
copy

SYNOPSIS

elink [OPTIONS] [URL...]

PARAMETERS

-dump
    Dumps formatted HTML content to standard output as plain text. This is often the default behavior when invoking elink.

-no-references
    Suppresses the display of document references (e.g., URLs for links and images).

-no-title
    Prevents the document title from being displayed in the output.

-source
    Displays the raw source code of the document (HTML, XML, etc.) instead of rendered text.

-dump-width
    Sets the preferred output width in columns for text dumping.

-dump-charset
    Specifies the character set to use for dumped output (e.g., UTF-8).

-user-agent
    Sets the User-Agent string sent in HTTP requests.

-header
    Adds an arbitrary HTTP header to the request (e.g., 'Accept: application/json').

-eval
    Executes ELinks commands (e.g., 'set document.codepage.assume_cp852 = 1').

-config-file
    Uses an alternative configuration file instead of the default.

-no-home
    Prevents loading anything from the user's home directory (e.g., history, bookmarks, or personal configuration).

-help
    Displays a summary of command-line options and exits.

-version
    Prints the version information of ELinks and exits.

DESCRIPTION

elink is commonly a symbolic link or wrapper script for the elinks text-mode web browser, specifically configured for non-interactive use. Its primary function is to fetch the content of web pages or other network resources and dump them to standard output in a readable text format. Unlike the full elinks browser, elink is typically used in scripts or pipelines for tasks such as web scraping, extracting plain text from HTML documents, or quickly viewing a webpage's content without launching an interactive browser session. It processes HTML, renders it to plain text, and can be controlled with various command-line options to fine-tune output and behavior.

CAVEATS

The functionality of elink is entirely dependent on the underlying elinks program. It is often a symbolic link or a simple wrapper script that invokes elinks, typically with the -dump option by default.
As a text-mode browser, it cannot process or render complex JavaScript, Flash, or other rich multimedia content. Its primary utility is for static HTML and plain text retrieval.
Network connectivity and firewall rules can affect its ability to fetch content. User-specific elinks configuration files can also influence elink's behavior.

COMMON USAGE PATTERN

While elinks is an interactive browser, elink is predominantly used for non-interactive tasks. Its most common use is fetching a URL and printing its text-rendered content to standard output, making it ideal for piping into other commands or for simple web scraping within shell scripts.

OUTPUT FORMATTING

The -dump option attempts to format the HTML content for readability on a terminal, including handling line wrapping, headings, and lists. However, complex layouts or CSS styling are largely ignored. Options like -dump-width and -dump-charset provide some control over the final text output.

HISTORY

elink itself doesn't have an independent history; its development is tied directly to the elinks project. elinks originated as a fork of the Links text-mode web browser in 2000, aiming to add features like tabbed browsing, support for tables, and more robust handling of modern web content while remaining lightweight. The elink command emerged as a convenient alias or wrapper for `elinks -dump`, facilitating its use in scripting and non-interactive contexts where only the rendered text content of a URL was needed.

SEE ALSO

elinks(1), curl(1), wget(1), lynx(1), links(1)

Copied to clipboard