Units

I was recently reminded of the excellent ‘units’ program, available with all good Unix systems.

Units will convert quantities expressed in one unit in to another unit. Here’s an example:


$ units
2439 units, 71 prefixes, 33 nonlinear units

You have: 12 miles
You want: kilometres
* 19.312128
/ 0.051780933
You have:

So, 12 miles is equivalent to 19.312128 kilometres. OK, that was an easy one to warm up with. Units knows about all kinds of arcane measures and can happily convert between them all. Here’s an example from the man page:


$ units
2439 units, 71 prefixes, 33 nonlinear units

You have: furlongs per fortnight
You want: m/s
* 0.00016630952
/ 6012.8848
You have:

I actually needed to use units to find out my weight in kilos:

$ units
2439 units, 71 prefixes, 33 nonlinear units

You have: 20 stone + 1 lb
You want: kilos
conformability error
127.45946 kg
1000
You have:

My goodness, that’s a large number!

Units should be available in most versions of Unix and Linux - just get a terminal session (telnet or ssh for example) and type in ‘units’. As usual, read the manual page by typing ‘man units’.

Leave a reply

You must be logged in to post a comment.