• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

pi Command Examples in Linux

by Deepika

The pi command is a command-line tool that calculates the mathematical constant π (pi) to a specified number of decimal places. The calculation of π is based on Archimedes’ method, which involves inscribing and circumscribing polyggonal shapes around a circle and successively increasing the number of sides to estimate the value of π.

The pi command can be used in a variety of environments, including Unix-like systems and Windows command prompt, to quickly compute the value of π to the desired precision. For example, to calculate π to 20 decimal places, you would run the following command:

# pi 20

This would output the following result:

3.1415926535897932384

The pi command is a useful tool for anyone who needs to perform calculations involving π, such as students, researchers, and engineers. Additionally, it is a fun way to explore the properties of the mathematical constant and learn more about the fascinating history of its discovery and computation.

pi Command Examples

1. Display 100 decimal digits of Archimedes’ constant Pi:

# pi

2. Display a specified number of decimal digits of Archimedes’ constant Pi:

# pi number

3. Display help:

# pi --help

4. Display version:

# pi --version

5. Display recommended readings:

# pi --bibliography

Filed Under: Linux

Some more articles you might also be interested in …

  1. po4a-updatepo Command Examples in Linux
  2. mediainfo Command Examples
  3. pvdisplay Command Examples in Linux
  4. CentOS / RHEL : How to find which user run a specific command?
  5. Arcanist: A CLI for Phabricator (arc Command Examples)
  6. kitty Command Examples
  7. namcap: command not found
  8. ect: Efficient Compression Tool
  9. getcap: command not found
  10. i3-scrot Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright