Computers have become indispensable devices for most people, as they offer important functions. Not only do we use them to browse the web and create documents, but from them we manage many of us email, access social networks or download and store different documents ..
One of the tools that have been and will continue to be present in all operating systems is the calculator thanks to which we frequently resort to calculate many goals such as making our salary, set goals, knowing how much we should cancel from some debt and more.
In the case of Linux operating systems, there are several ways on how we can use the calculator and today we will see each one in detail..
1. How to use the gcalccmd command in Linux
Step 1
This is the integrated console version of Gnome Calculator which we find in distributions with this type of environment, its use is simple since we must access the terminal and run it directly there:
gcalccmd
Note
If you do not have it, we can install it by executing the sudo apt install gnome-calculator command
Step 2
Once we execute this command we can execute the necessary operations of the calculator:
Step 3
In addition to this we can execute operations such as square root calculation with the sqrt parameter:
Step 4
We can detect the natural log of a number using ln:
Step 5
For those who are lovers of mathematics, we can use the sine, cosine or tangent variables (sin, cos, tan). To return to the terminal we will use the Ctrl + C keys.
2. How to use the Qalc command on Linux
Step 1
This command is the version for the terminal of the Qalculate application which allows us to perform different mathematical actions in Linux especially the conversion of currencies, for its installation we execute the following:
sudo apt install qalc
Step 2
Enter the letter S to accept the download and installation of the utility and after this process the available exchange rates should be updated, in case this does not happen, we will execute the qalc command in the terminal and then execute exrates:
Step 3
Then we can make use of some currency conversion:
Step 4
In addition to this, it will be possible to perform conversions along with regular calculations as in the following example. To return to the terminal we will use the Ctrl + C keys.
3. How to use the bc Linux command
The command bc (basic calculator) is one of the most used in Linux for its various functions at the level of calculations.
Step 1
For its execution it is enough to access the terminal and execute bc and there execute all the desired operations:
BC actions
With bc it will be possible to carry out actions such as:
- Increase or decrease operators
- Comparative or relational operators
- Logic or Boolean operators
Step 2
In bc the -l parameter allows you to set the default scale (digits after the decimal point) to 20 and similarly define the standard mathematical library:
Step 3
We can make use of common shells like bash, ksh, csh, in order to execute the arguments in bc directly, we can execute the following:
bc - l <<< “3 * 7/4â€
Step 4
It is possible to use bc non-interactively as follows. To return to the terminal we must execute the term quit.
echo '8/4' | bc
4. How to use calc Linux command
Step 1
Calc is another of the terminal calculator utilities with which we can perform various actions, for its installation we will execute the following:
sudo apt install apcalc
Step 2
Enter the letter S to confirm the download and installation and then execute calc and proceed to perform the desired operation:
Step 3
Calc parameters
The use of calc is composed of some parameters such as:
- -c: Continue reading the command lines even after an analysis error.
- -C: Allows the execution of custom built-in functions, the default is the custom built-in function ()
- -d: Disables printing of the opening title.
- -D: Forces the initial value of config.
- -e: Ignore the environment variables at the beginning of the app.
- -f: It is used in the Shell mode of scripts.
- -h: Displays the help of the command.
With calc we can perform additional operations such as square root, sine, cosine or tangent:
5. How to use the Expr Linux commands
This command can be executed directly in the terminal to carry out the desired operations without requiring additional installations.
Thus, the options to perform our mathematical operations on Linux are broad and functional.