units
Convert between measurement units
TLDR
SYNOPSIS
units [options] [from-unit] [to-unit]
DESCRIPTION
GNU Units converts between different systems of measurement and performs unit arithmetic. It includes a comprehensive database of over 3000 units, including historical and esoteric measurements.In interactive mode, enter the source unit at the "You have:" prompt and the target unit at "You want:". Units checks dimensional compatibility and reports conformability errors for incompatible conversions.The program also functions as a scientific calculator with built-in functions (sin, cos, ln, exp, etc.). Complex expressions with units are supported.
PARAMETERS
-f filename, --file filename
Use specified units database file.-c, --check
Check that all units reduce to primitive units.-o format, --output-format format
Specify numeric output format (printf-style).-d ndigits, --digits ndigits
Set number of significant digits in output.-e, --exponential
Use scientific (exponential) notation for output.-t, --terse
Print only the conversion factor (for parsing).--compact
Give compact output without operators.-q, --quiet
Suppress statistics and prompts.-v, --verbose
Show more detailed output.--list-units
List all known units and exit.--conformable
Show units conformable with the given expression.-u system, --units system
Use alternative unit system (e.g., si, cgs, natural).--locale locale
Force a specific locale.--minus
Interpret - as subtraction (default).--product
Interpret - as multiplication.-V, --version
Print version and data file location.-h, --help
Display help message.
CAVEATS
Attempting to convert between dimensionally incompatible units (e.g., meters to seconds) produces a conformability error. The units database location varies by installation; use -V to find it. Custom unit definitions can be added to personal unit files.
HISTORY
The original Unix units program was included in early versions of Unix. GNU Units was written by Adrian Mariano as a free implementation with an expanded unit database. It was first released in 1996 and is maintained as part of the GNU Project. The program includes units from ancient civilizations, historical measurements, and modern scientific standards.
