The Wayback Machine - https://web.archive.org/web/20230512155454/https://www.geeksforgeeks.org/factor-command-in-linux-with-examples/
Skip to content
Related Articles
Get the best out of our app
GeeksforGeeks App
Open App
geeksforgeeks
Browser
Continue

Related Articles

factor command in Linux with examples

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

The factor command in Linux is used to print the prime factors of the given numbers, either given from command line or read from standard input.

The numbers given through standard input may be delimited by tabs, spaces or newlines.

Syntax:

factor [NUMBER]
  • Factor 100 (non-prime number):
    prime factors of 100
    We get the prime factors 2 and 5 that make up 100.
  • Factor 13 (prime number itself) :
    prime factors of 13
  • Factor of 221 (product of two primes) :
    Prime factor of 221

    Under the hood, the factor command uses the Pollard-Brent rho algorithm to find out the prime factors.

  • factor --help : This command only supports a few numbers of options, that is its help command and version number.
    Factor help command
My Personal Notes arrow_drop_up
Last Updated : 15 May, 2019
Like Article
Save Article
Similar Reads
Related Tutorials