How to use Linux Terminal as a computer
Do you like the simplicity of terminals in Linux more than GUI or use? If you need to do some math quickly, you should not use a computer application. You can perform your calculations using a terminal, through the tools you (probably) have installed.
Join TipsMake.com to learn how to use the terminal in Linux as a computer, regardless of which distribution you are running, via the following article!
Calculate with GNU bc
Bc in GNU bc stands for 'basic calculator'. This bc program itself originated in Unix in the 1970s. GNU bc is a more advanced and modern version that you can find on your Linux system.
If you don't have GNU bc, use the package manager that your distro uses to install it. This package is simply called bc. To start, open the terminal and type bc
before pressing Enter
. Type quit
to exit the program after you're done.
The plus, minus, backslash and asterisk are used for calculations. The first two signs (addition and subtraction) are simple, while backslashes are used instead of division and asterisks represent multiplication.
You can also use parentheses, variables, arrays, algebra expressions, etc. Readers can learn more through the GNU user guide at:
https://www.gnu.org/software/bc/manual/html_mono/bc.html
Calculation with Calc
An alternative to bc is calc, a tool based on another terminal. Like bc, calc has another old Unix tool that continues to be supported on Linux. The installation package is called apcalc on Ubuntu and Debian-based systems but can be found under the name calc elsewhere.
To open calc, just type calc
in the terminal and press Enter
. Like bc, you will need to use typical operators. For example: 5 * 5
to represent 5 x 5 calculations.
When you're done, press Enter
. The answer will appear immediately below. When you're done, enter quit
and press Enter
.
Use terminal commands directly (Echo and Expr)
You do not need to have any additional programs or packages to perform basic calculations with terminals in Linux. A typical Bash shell allows you to perform basic calculations using echo yourself. For example, you can do this if you plan to use math as part of the bash script.
You can also use expr , a tool that comes with coreutils , found on most Linux and Unix-based systems. Expr can also be used in bash scripts, like with echo.
To use echo, enter the following command in the terminal:
echo $((2*2))
In which 2 * 2 is the calculation you selected. Press Enter
and you will get the answer to your calculation.
To use expr, enter expr
, followed by your calculation. Again, this is only applicable to simple calculations (not usable with trigonometry).
For example, expr 33 * 2
will represent 33 multiplication by 2 (33 x 2). The "" backslash before an asterisk is required for multiplication here, but does not apply to other operators.
Echo and expr can be used if you only want to perform basic calculations. If you need something more advanced, choose another method listed here.
Calculate with Qalc
If you like an option with a few extra features, like currency conversion, Qalc is the right tool for you. Qalc is 'cousin' with Qalculate, a cross-platform computing tool with GUI.
Please use the distribution package manager to install the qalc package. Start by typing qalc
in the terminal and press Enter
.
Qalc is the most comprehensive and user-friendly terminal calculation application for Linux users. Qalc will also remember the calculations that have been performed, as well as present the neat answer below.
If you want to make currency conversion, you will need to start with qalc and then enter exrates
to update the previous exchange rate.
Math is not something that is easy to master overnight, but you can eliminate the hassle of fast Linux calculations, using a terminal. Tools like echo and expr, as well as some popular software like GNU bc, make it easy, quick and easy to calculate numbers.
Which Linux calculation tool is easiest for you? Do you particularly like any of these tools? Please share your comments in the comment section below!
Hope you are succesful.
You should read it
- Top 7 best Linux terminal emulators
- How to use Guake Terminal in Linux
- How to install dictionaries in Linux Terminal
- How to back up and restore Linux Terminal history
- 14 interesting Linux commands in Terminal
- How to play Game Boy games on Linux Terminal
- 5 interesting entertainment games in Linux Terminal
- How to run 2 or more Terminal commands at the same time on Linux
- How to fix the problem of being unable to enter Terminal in Linux
- How to create and delete folders in Linux Terminal
- How to search Google from Linux terminal with Googler
- How to Create and Edit Text File in Linux by Using Terminal
Maybe you are interested
Detailed causes of the error of not being able to change the font color in Excel
Why Stop Using Free AI Tools? What to Use Instead?
How to Use Scribe Al to Troubleshoot Home Computers
How to Use Type to Siri to Eliminate Public Embarrassment
10 Best Ways to Use Embedded Images in Email Newsletters
Many Samsung users found using 'samsung' as password