LinuxCommandLibrary

is-up

Check if a host is reachable

TLDR

Check the status of the specified website

$ is-up [example.com]
copy

SYNOPSIS

is-up [options] <host> [<port>]

PARAMETERS

-h, --help
    Display help and exit

-v, --version
    Display version and exit

-t, --timeout <ms>
    Connection timeout in milliseconds (default: 5000)

-r, --retries <n>
    Number of retries before failing (default: 0)

--json
    Output in JSON format for scripting

--exit-code
    Exit with codes: 0=up, 1=down, 2=timeout, 3=error

DESCRIPTION

The is-up command is a lightweight Node.js-based CLI tool designed to verify if a remote host is accepting TCP connections on a specified port. It attempts to open a socket connection and reports whether the host is reachable ('up') or not ('down'), including response time on success. Default port is 80 (HTTP), making it ideal for quick web server checks.

Primarily used in shell scripts, monitoring, deployment pipelines, and automation for health checks without relying on ICMP (like ping, which may be blocked). Output is human-readable by default with emojis (✓ for up, ✗ for down), but supports JSON for programmatic use.

Installation requires Node.js: npm install --global is-up. It's cross-platform but commonly used on Linux for its simplicity and low overhead compared to full HTTP clients like curl.

CAVEATS

Not a native Linux command; requires Node.js/npm. Firewalls or port blocks may cause false negatives. No ICMP fallback like ping.

EXAMPLES

is-up google.com
✓ google.com is up (15ms)

is-up example.com 443 --timeout 2000
✗ example.com:443 is down (timeout=2000ms)

EXIT CODES

0: host up
1: host down
2: timeout
3: other errors (DNS, etc.)

HISTORY

Created by Sindre Sorhus in 2015 as a minimalistic TCP probe. Part of his prolific npm ecosystem for testing/tools; actively maintained with latest v5+ supporting modern Node.

SEE ALSO

ping(8), nc(1), telnet(1), curl(1)

Copied to clipboard