*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: units | Section: 1 | Source: Digital UNIX | File: units.1.gz
units(1) General Commands Manual units(1) NAME units - Converts units from one measure to another SYNOPSIS units [-] [file] DESCRIPTION The units command converts quantities expressed in one measurement to their equivalents in another. The units command is an interactive com- mand. It prompts you for the unit you want to convert from and the unit you want to convert to. The units command does multiplicative scale changes only. That is, units can convert from one value to an- other only when the conversion is done with a multiplication factor. For example, units cannot convert between degrees Fahrenheit and de- grees 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 di- vision 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 (for example, lightyear). Prefix British units differing from their American counterparts with br (for example, brgallon). The /usr/share/lib/units file contains a complete list of the units that the units command uses. Most familiar units, abbreviations, and metric prefixes are recognized by the units command, together with the following: Ratio of circumfer- ence to diameter. Speed of light. Charge on an electron. Accelera- tion of gravity. Same as g. Avogadro's number. Pressure head per unit height of water. Astronomical unit. The - argument causes units to display a list of all known units and their conversion values. The file argument specifies an alternative units file to be used instead of the default file units. EXAMPLES To start the units command, enter: units Now you can try the following examples. To display conversion factors, enter: you have: in you want: cm * 2.540000e+00 / 3.937008e-01 The output from the units command tells you to multiply the num- ber of inches by 2.540000e+00 to get centimeters, and to multi- ply the number of centimeters by 3.937008e-01 to get inches. These numbers are in standard exponential notation, so 3.937008e-01 means 3.937008 x 10-1, which is the same as 0.3937008. The second number is always the reciprocal of the first; for example, 2.54 equals 1/0.3937008. To convert a mea- surement to different units, enter: you have: 5 years you want: microsec * 1.577846e+14 / 6.337753e-15 The output shows that 5 years equals 1.577846 x 1014 microsec- onds, and that 1 microsecond equals 6.337753 x 10-15 years. To give fractions in measurements, enter: you have: 1|3 mi you want: km * 5.364480e-01 / 1.864114e+00 The | (vertical bar) indicates division, so 1|3 means one-third. This shows that one-third mile is the same as 0.536448 kilome- ters. To include exponents in measurements, enter: you have: 1.2-5 gal you want: floz * 1.536000e-03 / 6.510417e+02 The expression 1.2-5 gal is the equivalent of 1.2 x 10-5. Do not type an e before the exponent. This example shows that 1.2 x 10-5 (0.000012) gallons equal 1.536 x 10-3 (0.001536) fluid ounces. To specify complex units, enter: you have: gram cen- timeter/second2 you want: kg-m/sec2 * 1.000000e-05 / 1.000000e+05 The units gram centimeter/second2 mean "grams x centimeters/sec- ond2." Similarly, kg-m/sec2 means "kilograms x meters/sec2," which is often read as "kilogram-meters per seconds squared". If the units you specify after you have and you want are incom- patible, enter: you have: ft you want: lb conformability 3.048000e-01 m 4.535924e-01 kg The message conformability means the units you specified cannot be converted. Feet measure length, and pounds measure mass, so converting from one to the other does not make sense. There- fore, the units command displays the equivalent of each value in standard units. In other words, this example shows that 1 foot equals 0.3048 me- ters and that 1 pound equals 0.4535924 kilograms. The units com- mand shows the equivalents in meters and kilograms because the command considers these units to be standard measures of length and mass. Entering <Ctrl-d> causes you to exit from the units program. FILES Contains units and their conversion values. units(1)

Navigation Options