math sum for math
Returns the sum of a list of numbers or of each column in a table.
Signature
> math sum {flags}
Input/output types:
| input | output |
|---|---|
| list<number> | number |
| list<duration> | duration |
| list<filesize> | filesize |
| range | number |
| table | record |
| record | record |
Examples
Sum a list of numbers.
> [1 2 3] | math sum 6
Get the disk usage for the current directory.
> ls | get size | math sum
Compute the sum of each column in a table.
> [[a b]; [1 2] [3 4]] | math sum ╭───┬───╮ │ a │ 4 │ │ b │ 6 │ ╰───┴───╯
Copyright © 2019–2026 The Nushell Project DevelopersLicensed under the MIT License.
https://www.nushell.sh/commands/docs/math_sum.html