← 返回命令列表

Linux command

qalc 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Calculate expression

qalc "[2 + 2]"

Convert units

qalc "[5 kilometers to miles]"

Interactive mode

qalc

Currency conversion

qalc "[100 USD to EUR]"

Scientific calculation

qalc "[sin(45 degrees)]"

Display result in hexadecimal

qalc -b 16 "[255]"

Terse output

qalc -t "[2^16]"

说明

qalc is the command-line interface to the Qalculate library, providing a powerful calculator with support for mathematical expressions, unit conversions, currency exchange, and symbolic computation. It handles everything from basic arithmetic to complex expressions involving trigonometric functions, logarithms, integrals, and physical constants. A standout feature is built-in awareness of physical units and currencies, allowing natural expressions like "5 kilometers to miles" or "100 USD to EUR". Exchange rates can be updated automatically. In interactive mode, qalc provides a persistent session with command history and tab completion.

参数

-t, --terse
Reduce output to just the result.
-f _FILE_, --file _FILE_
Execute commands from a file first.
-e, --exrates
Update exchange rates.
-b _BASE_, --base _BASE_
Set the number base for results.
-c, --color
Use colors to highlight expressions and results.
-i, --interactive
Start in interactive mode.
-l _TERM_, --list _TERM_
List matching variables, functions, units, and prefixes.
-s _"OPTION VALUE"_, --set _"OPTION VALUE"_
Set a configuration option (e.g., -s "base 16").
-p _BASE_, --prog _BASE_
Start in programming mode with base conversion.
-n, --nodefs
Do not load any functions, units, or variables from file.

FAQ

What is the qalc command used for?

qalc is the command-line interface to the Qalculate library, providing a powerful calculator with support for mathematical expressions, unit conversions, currency exchange, and symbolic computation. It handles everything from basic arithmetic to complex expressions involving trigonometric functions, logarithms, integrals, and physical constants. A standout feature is built-in awareness of physical units and currencies, allowing natural expressions like "5 kilometers to miles" or "100 USD to EUR". Exchange rates can be updated automatically. In interactive mode, qalc provides a persistent session with command history and tab completion.

How do I run a basic qalc example?

Run `qalc "[2 + 2]"` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -t, --terse do in qalc?

Reduce output to just the result.