Display Multiplication Table With A Command Line

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/

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK Pi 4C Plus

Leave a Reply

Your email address will not be published. Required fields are marked *

Khadas VIM4 SBC
Khadas VIM4 SBC