Linux dc Command
What is Linux dc Command?
dc COMMAND:dc command is a desk calculator command and it's very similar to basic calculator. It is used to easily calculate all the basic arithmetic operations. It is older version compared to bc command.
||Used for compilation alone.
||Start up the scale to 20, instead with the default zero. Explains the Math Functions.
||Not an important command. Calculates the file name of the basic calculator command.
- Multiplication operation using dc command
echo '3 4 * p' | dc
The above command is used for mathematical calculations.
- Additional operation using dc command
echo '3 4 + p' | dc
The above command displays the sum of '3+4'.
- Mathmatical operation from text file
'calc.txt' file have the following code:8 4 + p. Get the input from file and displays the output.