5 Useful Ways to Do Arithmetic in Linux Terminal

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

15 Responses

  1. RSYDW says:

    Well this is a great article, options except bc is more inclined to developers. In most of the cases for UNIX Linux admin bc is the best friend. There is always multiple way to do single task ultimately result matters

    Nice work.

    Thanks for sharing.

  2. Jim says:

    It is nice, but a calculator (physical or software) seems much easier.

  3. Tim Verbois says:

    Awk is a special case since this is basically an interpreter of the awk language. Like that, you could also use perl, python, php, with oneliners.

    Another basic calculator is let:

    # let total=20+5
    

    Results in $total being 25

  4. Ulenaers Franz says:

    Another way is using perl command:

    # perl -wlne 'print eval';
    

    then do the calculations

    5*6*9
    270
    12/5
    2.4
    10/3
    3.33333333333333
    ....
    
  5. 01101001b says:

    Great article! Thanks!

  6. Justin says:

    Why not PowerShell? Available on most OS and far easier than anything you have here

  7. ProDigit says:

    Interesting! Saved as a bookmark!

Leave a Reply to Jim Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.