factor
Find prime factors of an integer
TLDR
Display the prime-factorization of a number
Take the input from stdin if no argument is specified
SYNOPSIS
factor [number]...
DESCRIPTION
The factor command in Linux is a simple utility used to find the prime factors of a given positive integer. It takes one or more integers as input and prints each number along with its prime factors, one factor per line. The factor command primarily serves as a quick and easy tool for educational purposes or for simple prime factorization tasks. It's not particularly suitable for very large numbers as it relies on basic trial division and can become slow.
CAVEATS
The factor command is relatively inefficient for factoring large numbers because it uses trial division. There are no options to control algorithm behavior.
USAGE EXAMPLES
To factor the number 12:
factor 12
To factor multiple numbers:
factor 12 36 100
Factor a very large number:
factor 123456789101112 (Can be slow)
HISTORY
The factor command has been a part of Unix-like operating systems for a long time, appearing in early versions of the Unix system. It has remained largely unchanged in its functionality. It's a basic arithmetic utility that has consistently served a simple purpose.