Factor (Unix)

From Wikipedia, the free encyclopedia
Jump to: navigation, search

On Unix-like computer systems, factor is a utility for factoring an integer into its prime factors.

factor first appeared on 5th edition Research Unix in 1974, as a "user maintained" utility (section 6 of the manual). In the 7th edition in 1979, it was moved into the main "commands" section of the manual (section 1). From there, the factor utility was copied to all other variants of Unix, including commercial Unixes and BSD. In some variants of Unix, it is classified as a "game" more than a serious utility, and therefore documented in section 6.

A free software version of the factor utility was written for the GNU project by Paul Rubin, in 1986. It is now available on all Linux distributions as part of the GNU Core Utilities. In 2008, GNU factor started to use GNU MP library for arbitrary-precision arithmetic, allowing it to factor integers of any size, not limited by the machine's native datatypes.

Syntax: factor [number or variable]

This command can be used by typing a number with it or a variable that has some integral value. Various projects that include simple ones like printing prime numbers have been made easy by using this command. To know more on this, you can type "man factor" in Unix terminal and get full information on who created it, its copyright and various other information. To get its usage type "factor --help" and for information about its version, type "factor --version". To get a broader information on its arguments you can also type "info factor" which gives you a long list of information on that command.


  1. manual page from Fifth Edition Unix (section 6: "user maintained programs)
  2. factor manual page from Sixth Edition Unix (section 6: "user contributed").