Existe o comando factor disponível da seguinte forma:
NAME
factor - factor numbers
SYNOPSIS
factor [NUMBER]...
DESCRIPTION
Print the prime factors of each specified integer NUMBER. If none are specified on the command line, read them from
standard input.
Exemplo:
$ factor 786
786: 2 3 131
$ factor 1234567890
1234567890: 2 3 3 5 3607 3803
Visite: man factor .