GNU 'units' program converts quantities expressed in various scales to their equivalents in other scales. The 'units' program can only handle multiplicative scale changes directly. It uses a functional notation for nonlinear conversions such a Fahrenheit temperature to Celsius temperature.
Andre L. sent in this great write up on the ever useful units command:
Suppose you know that somebody's private rocket got to a maximum height of 328491 feet and you want to know what that means in sane units. Here is a transcript of using units(1), first from the command line and then interactively, to discover this is the same as 100,124.06 meters:$ units '328491ft' 'm' * 100124.06 / 9.9876097e-06 $ units -v '328491 ft' 'm' 328491 ft = 100124.06 m 328491 ft = (1 / 9.9876097e-06) m $ units 2084 units, 71 prefixes, 32 nonlinear units You have: 328491ft You want: m * 100124.06 / 9.9876097e-06
The program can be used almost anytime you need to convert between different units. Here are some more examples:$ units 'tempF(100)' 'tempC' 37.777778 $ units 'furlong' Definition: 40 rod = 201.1684 m $ units 'furlong/fortnight' Definition: 0.00016630986 m / s $ units -v '1 cup sugar' 'grams' 1 cup sugar = 200 grams 1 cup sugar = (1 / 0.005) grams $ units -v 'brgallon' 'usgallon' brgallon = 1.2009499 usgallon brgallon = (1 / 0.83267418) usgallon $ units -v 'usgallon' 'cm^3' usgallon = 3785.4118 cm^3 usgallon = (1 / 0.00026417205) cm^3
Further instructions are available in the man page and info file.
More information on this package can be found on the Debian web site.
(If there is a package you would like to see featured here, go to the userinfo page and follow the directions there to submit your entry.)
Keep sending in these great writeups like Andre did!