Display Multiplication Table With A Command Line

Orange Pi Development Boards

If you forgot your multiplication table and happen to have a terminal window opened in Linux  at the time, here’s the command to use:

seq 9 | sed ‘H;g’ | awk -v RS=” ‘{for(i=1;i<=NF;i++)printf(“%dx%d=%d%s”, i, NR, i*NR, i==NR?”\n”:”\t”)}’

Same thing using perl:

Here’s the output:

Source (in French): http://www.tux-planet.fr/afficher-les-tables-de-multiplication-en-ligne-de-commande/

Leave a Reply

Notify of