Go figure, there’s a command that can convert some units to other units. The units command is able to take a number of one type of units and then convert them to another. For example, to convert a mile to feet: units "1 mile" feet Or to convert 2 hours to seconds: units "2 hours" seconds For a full listing of the formats supported, check out /usr/share/misc/units.lib.