Some of the time, we are in need to do some quick calculations while on console or terminal. Here what bc, a command line calculator, comes in handy.
In this short tutorial, I will show how to do some basic calculation with bc.
First launch bc by typing bc and hitting enter. You will see bc ready to take your commands.
bc bc 1.06 Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'.
To add two numbers, for example 234 and 567, type them as
234+567
You will get 801 as answer.
To multiply three number, say, 234, 567 and 678, write
235*567*678
and bc will promptly display the answer 90340110.
To divide a number, 210 by 10, type
210/10
which will give the result as 21.
To quit, type quit.
quit

















One Response
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.
Continuing the Discussion