Forrest logo
back to the seq tool

datamash:tldr:3ad5f

datamash: Get max, min, mean and median of a single column of numbers.
$ seq 3 | datamash max 1 min 1 mean 1 median 1
try on your machine

This command consists of two parts: seq 3 and datamash max 1 min 1 mean 1 median 1.

  1. seq 3: This command generates a sequence of numbers starting from 1 and ending at 3. The output will be the numbers 1, 2, and 3, each on a separate line.

  2. datamash max 1 min 1 mean 1 median 1: This command uses the datamash tool to compute various statistics on the data received from the previous command (seq 3).

    • max 1: Calculates the maximum value in the first column.
    • min 1: Calculates the minimum value in the first column.
    • mean 1: Calculates the mean (average) value in the first column.
    • median 1: Calculates the median value in the first column.

    Here, the first column represents the input data received from seq 3, which is the sequence of numbers 1, 2, and 3. For each of the statistics mentioned above, datamash will compute and display the respective value from the data.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the seq tool