A Go terminal UI for displaying network adapters in real time

Programming Snapshot – termui

Article from Issue 218/2019

Even command-line lovers appreciate a classic terminal UI. Mike Schilli shows how to whip up a Go program that dynamically displays network interfaces and IPs.

Every time I connect my laptop to a router for diagnostic purposes, the question arises: On which dynamically assigned IP address will the router see the laptop? After all, you need to enter a router address on the same subnet to display the router's admin page (Figure 1).

Figure 1: This machine uses an IP address on subnet to connect to the router.

To do this, I used to type ifconfig several times in a terminal window and extracted the desired address from the mess of data printed next to:


Use Express-Checkout link below to read the full article (PDF).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Progress by Installments

    Desktop applications, websites, and even command-line tools routinely display progress bars to keep impatient users patient during time-consuming actions. Mike Schilli shows several programming approaches for handwritten tools.

  • Magic Day

    Math wizards amaze audiences by naming the day of the week for any date called out by the audience. Mike Schilli writes a training program in Go to turn amateurs into headline performers.

  • Core Technologies

    Prise the back off Linux and find out what really makes it tick.

  • Command Line: Network Diagnostic Tools

    Linux has the right tools to track down network errors and open the way for data packets.

  • Perl: Shell Functions

    Perl gives you better shell scripts. Sysadm::Install, a new module from CPAN, helps shell addicts let go of Bash.

comments powered by Disqus

Direct Download

Read full article as PDF:

Price $2.95