The sys admin’s daily grind – ifdata Info

Precision Interfacing

Article from Issue 148/2013
Author(s):

Script-friendly ifdata from the Moreutils package delivers absolutely precise network interface status information, with no need to extract individual values.

When I need to know whether a particular interface exists – and, if so, what IP address and MTU it has – my script is inevitably bulky. I then bombard the results of ip addr show eth0, ifconfig, or iwconfig with grep, cut, and regular expressions until the requested information is chiseled out. In contrast, ifdata from the Moreutils package solves my task elegantly. I can use parameters to control the ifdata output so that only the desired result appears, which is ideal for ongoing processing in a script.

Buy this article as PDF

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

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Hot Stuff!

    This month, sys admin columnist Charly dumps the moreutils toolbox on his workbench and takes combine and vidir for a spin.

  • Charly's Column: GestióIP

    A tidy house, a tidy mind they say, and I’ll leave it up to you to consider what being disorganized might mean. Anybody who has tried to manage hundreds of IP addresses using just a sheet of paper or a spreadsheet will probably appreciate some help.

  • Charly's Column

    Charly often gets suggestions and ideas for his column at community get-togethers. Last week, he picked up a tip for an early warning system that quickly secures login attempts.

  • Charly's Column

    Using SQL to sift syslog data out of a database is an admittedly universal, but also fairly convoluted approach. phpLogCon, with its web interface, gives admins an easier option.

  • Charly's Column – Doorbell Pi

    When Charly puts on his headphones at home, he often fails to hear the doorbell. So, he dreamed up a solution with a Raspberry Pi Zero, a noise detector, and a power outlet with a LAN connection.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News