Get the mean of a single column of numbers with a given decimal precision

datamash

  • Tool to perform basic numeric, textual and statistical operations on input textual data files.
    More information: <http://www.gnu.org/software/datamash/>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

echo -e '1\n2\n3\n4\n5\n5' | datamash -R {{number_of_decimals_wanted}} mean 1

click the source code to copy install datamash on any operating system with command-not-found.com