I know the program launchy
from Windows (and it is also available in Ubuntu) in which I can simply enter 100/9.14 and get the result without opening a calculator. But I don't want to install the whole program just to do that...
Is there a simple command line tool I can use?
I'd start a
python
interpreter to perform such simple operations:Please check this link for a list of
python
mathematical operators.Use
bc
, it does exactly what you want and it also has some other features, like variables, configurable input/output base (great for converting hex/dec/bin and so on) and others.The answer suggesting
bc
is certainly a good way to go. However, I like it even better with this simple wrapper, which I discovered quite serendipitously:As you can see, the idea was taken from pbrisbin.com, which is a site packed full of great ideas like these. (His goodsong script, e.g., made
MPD
become at least twice as awesome....)I would recommend/install synapse.
Ubuntu 12.04 and below:
sudo apt-get install synapse
Ubuntu 14.04: Is synapse application launcher available?
Launch synapse by searching for it in the dash and go to the preferences menu. You can use the synapse indicator to access the preferences.
Once the window opens up, click the plugins tab and enable the Calculator plugin.
See below:
Once done, anytime you launch synapse using Ctrl + Space you can just start typing your calculation and the results will be displayed in realtime.
See below: