27

I use the default Ubuntu calculator rather a lot, but to use it I have to use the Unity search feature to find it and then open it. I have tried to open it in Terminal with:

calculator

And:

Calculator

But neither of those seem to launch, so how do I launch the calculator through Terminal? What command do I use? Also, as my Unity Dock is rather full, it's not really an option just to put a link to it there.

  • 2
    BTW, you should check out some alternatives to the simple Gnome calculator which run in the terminal. dc is the classic, and in some ways similar to a desktop calculator... but IMO that's not really good workflow; I'd recommend the REPL of a modern functional language like python or Haskell (ghci). Those can do anything a traditional calculator can, plus much, much more. – leftaroundabout May 25 '15 at 19:29
  • Or: you can calculate stuff right in the shell! – leftaroundabout May 25 '15 at 19:35
32

Try to type:

gnome-calculator

Or for Older version (Ubuntu 12.04 and before):

gcalctool
  • 1
    gcalctool won't work – Pilot6 May 25 '15 at 13:54
  • 1
    @Pilot6 you're right, i just modify it :) – Bilal May 25 '15 at 14:00
  • $ galculator should work. the c is replaced by g. Don't type gc... – Antonio Dec 19 '17 at 19:27
20

Always when you have such a question in mind, ie, you don't know the name of the tool to invoke it in command line, find it from the terminal itself:

man -k <keyword>

It will search the manual page names and descriptions for the keyword you specified and prints the titles. In your case, it would be:

man -k calculator

As an illustration, if you want to invoke the webcam tool you can type something like:

man -k camera

man -k is equivalent to apropos.

  • 1
    This is a vastly better answer than the accepted answer. It teaches "how now" but also, briefly, digs into how to help "how later." – rp. Sep 30 '17 at 18:16
6

Qalculate! is awesome tool for desktop.

To install it: sudo apt-get install qalculate.
Terminal version sudo apt-get install qalc.


Converts currency:

 $ qalc 100 dollars to euro
 100 * dollar = approx. EUR 90.017103

 $ qalc 100AUD = x EUR
 (100 * dollar) = (x * euro) = approx. x = 90.017103

Works with percent:

 $ qalc 87.12 + 13.3%
 87.12 + (13.3 * procent) = 87.253

Gets Unix timestamps:

 $ qalc timestamp today
 timestamp("2015-08-14") = 1.4394996E9

Operates boolean:

 $ qalc true != false
 true != false = 1

Also you can do ln -s /usr/bin/qalc /usr/bin/c for shorthand:

 $ c "(2+2)*2"
 (2 + 2) * 2 = 8
  • gnome-calculator no longer works for me after adding some extensions to gnome, something to do with control of display (MPFR assertion failed...core dump) but this works perfectly, so nice one for that! It's also somewhat better than the default, so can't recommend enough. – dardisco Nov 1 '18 at 8:39
4

The command is gnome-calculator

1

I created an alias for this in ~/.bash_aliases as follows

calc="gnome-calculator &"

save the file and then type the following in the terminal

source ~/.bash_aliases

You can now launch the calculator using calc in the terminal.

  • This doesn't really answer the question which is about how to actually launch it. That is I was asking for its command-line name, so although your answer might actually be good as an additional edit, it's unhelpful and somewhat odd as a stand-alone answer. – user364819 Feb 22 '18 at 21:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy