How to perform calculation in Linux using expr command?

Print the value of EXPRESSION to standard output. A blank line below separates increasing precedence groups. It’s part of core utils so, we no need to install it.

expr command to perform calculation :
Use the following format for basic calculations.

For addition

$ expr 5 + 1
6
For subtraction

$ expr 5 – 1
4
For division.

$ expr 10 / 2
5

Leave a Reply

Your email address will not be published.