Converts units in one measure to equivalent units in another measure.
units [ - ] [ File ]
The units command converts quantities expressed in one measurement to their equivalents in another. The units command is an interactive command. It prompts you for the unit you want to convert from and the unit you want to convert to. This command only does multiplicative scale changes. That is, it can convert from one value to another only when the conversion involves a multiplication. For example, it cannot convert between degrees Fahrenheit and degrees Celsius because the value of 32 must be added or subtracted in the conversion.
You can specify a quantity as a multiplicative combination of units, optionally preceded by a numeric multiplier.
Indicate powers by entering suffixed positive integers, and indicate division with a / (slash).
The units command recognizes lb as a unit of mass, but considers pound to be the British pound sterling. Compound names are run together (such as lightyear). Prefix British units differing from their American counterparts with br (brgallon, for instance).
The /usr/share/lib/unittab file contains a complete list of the units that the units command uses. You can also define new units in this file. The File parameter may be used to override the values of the standard conversion factors listed in the /usr/share/lib/unittab file. The specified file must follow the same format as the unittab file.
Most familiar units, abbreviations, and metric prefixes are recognized by the units command, as well as the following:
| Item | Description | 
|---|---|
| pi | Ratio of circumference to diameter | 
| c | Speed of light | 
| e | Charge on an electron | 
| g | Acceleration of gravity | 
| force | Same as g | 
| mole | Avogadro's number | 
| water | Pressure head per unit height of water | 
| au | Astronomical unit | 
| Item | Description | 
|---|---|
| - | Lists the conversion factors contained in the /usr/share/lib/unittab file before you are prompted to enter your conversion. | 
units
you have: in
you want: cm * 2.540000e+00 
/ 3.937008e-01These numbers are in standard exponential notation, so 3.937008e-01 means 3.937008 x 10-1, which is the same as 0.3937008.
Note: The second number is always the reciprocal of the first; for example, 2.54 equals 1/0.3937008.
units
you have: 5 years
you want: microsec * 1.577846e+14 
/ 6.337753e-15units
you have: 1|3 mi
you want: km* 5.364480e-01 
/ 1.864114e+00units
you have: 1.2-5 gal
you want: floz* 1.536000e-03
/ 6.510417e+02units
you have: gram centimeter/second2
you want: kg-m/sec2* 1.000000e-05
/ 1.000000e+05you have: ft
you want: lbconformability
3.048000e-01 m
4.535924e-01 kgIn other words, this example shows that one foot equals 0.3048 meters and that one pound equals 0.4535924 kilograms. The units command shows the equivalents in meters and kilograms because the command considers these units to be the standard measures of length and mass.
| Item | Description | 
|---|---|
| /usr/bin/units | Contains the units command. | 
| /usr/share/lib/unittab | Lists units that the units command creates as well as units defined by the user. |