element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Community Hub
Community Hub
Polls When was the last time you used sed and/or awk?
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Leaderboard
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Community Hub to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: colporteur
  • Date Created: 1 Apr 2021 4:00 PM Date Created
  • Last Updated Last Updated: 11 Oct 2021 3:00 PM
  • Views 1597 views
  • Likes 0 likes
  • Comments 20 comments
Related
Recommended

When was the last time you used sed and/or awk?

I'm thinking of preparing a lecture, for a High School Computer Club, on the command line tools sed and awk for data manipulation. The discussion will include some examples of using the command to mung a data set. I found the commands valuable over my technology career but wonder how relevant are they today?

  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • jomoenginer
    jomoenginer over 4 years ago in reply to jomoenginer +4
    The advantage of using something like 'sed' or 'awk' or other shell type commands is that they are pretty much standard with most Linux type distros. Something like Python has to be installed separately…
  • neilk
    neilk over 4 years ago +3
    Sadly, I've never come across either! Neil
  • shabaz
    shabaz over 4 years ago in reply to neilk +3
    And rarely do they have non-cryptic names. There's something for everyone in Linux, worth playing around with (say) a Pi's command line to explore, but finding all the interesting commands can take a lifetime…
  • Jan Cumps
    Jan Cumps over 4 years ago in reply to jomoenginer

    The real unix guys at work would call me a micky mouse because I used online interactive regex test pages to test my expression, instead of terminal and keyboard image.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • jomoenginer
    jomoenginer over 4 years ago

    Daily

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 4 years ago in reply to shabaz

    Interesting fact from the 'AWK' Wiki site, AWK was created at Bell Labs in the 1970s,[6][better source needed] and its name is derived from the surnames of its authors: Alfred Aho, Peter Weinberger, and Brian Kernighan.

     

    I believe there were a couple more commands which were derived from initials of the developers.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 4 years ago in reply to neilk

    And rarely do they have non-cryptic names.

    There's something for everyone in Linux, worth playing around with (say) a Pi's command line to explore, but finding all the interesting commands can take a lifetime. Just discovered the other day for the first time a command to search for human-readable text among the noise.. called strings

    There's the obscure-sounding troff and groff, useful for converting text into printer format. And myriad other weird commands. nm is very cool, I used to use it a lot.. it searches binary files and tells you the names of all the functions inside.

    One command I wanted, but never found (I'm sure it could be fashioned from sed/awk very easily from those in the know, but I wouldn't know how!) was a command to hunt rows of data that definitely contained text from a 'good list' but to definitely not include the lines from a 'bad list'. The reason being, it would be useful for quickly going through large log files, by first setting up the good and bad lists. The good list could contain (say) "ERROR" and "DEBUG" and the bad list could contain "LEVEL1" and then you'd see only errors or debug lines that were level 2 or higher (for instance). Since it was too hard to figure out with regexp and Linux tools, I did it in C++ using the normal string library.

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • neilk
    neilk over 4 years ago

    Sadly, I've never come across either!

     

    Neil

    • Cancel
    • Vote Up +3 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • michaelkellett
    michaelkellett over 4 years ago

    It must be 20 years since I used AWK.

     

    I still have the book.

     

    MK

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • 14rhb
    14rhb over 4 years ago in reply to shabaz

    The flexibility of command line tools...

    and cascading command line functions with the pipe command makes it even better.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 4 years ago in reply to genebren

    The flexibility of command line tools with all the switches is always great to see : ) Apparently, some hacker was once caught because they happened to use an unusual combination of switches on 'ls' on the system they compromised.. (e.g. always typing "ls -al" instead of "ls -la" and so on).

    I like vi too : ) use it several times a week.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 4 years ago

    AWK is one of my go to tools for processing text.  I have used it in the past for a variety of projects, including some data analysis projects.  In one case, I used it to reduce large data sets (engine and airframe models) by finding the minimal number of data points necessary to interpolate (multiple methods - linear, bilinear, cubic and circular) data within a given error specification.  This reduced the development time over prior method of curve fitting and produced greater accuracy and faster execution time in the flight management controller systems that we were designing.

     

    I have a couple of tool sets that allow me to use these tools on my windows-based computer and I use them somewhat frequently.  Having spent a lot of time developing software on UNIX/LINUX, I have fond memories using a variety of these tools. with my favorites being VI, GREP, AWK and FIND.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 4 years ago

    Had you asked a few weeks ago, I would have said I last used it about 10 years ago. But someone asked me a sed question a few weeks back. I think it's handy having knowledge of such tools, and the underlying regexp is still handy to know too, but today I cannot recall much except say how to identify the beginning of a string, and how to match on a set of characters, etc. But I still have a regexp book somewhere just in case the need crops up.

    Since you mention specifically data manipulation, if a programming language is preferred then there are preferred or popular languages. For that, Python would be among the top few preferences for data manipulation for many I think (and there are more specialized languages too, I'm just picking an all-rounder) - and is encountered in many places, not just on a computer's command line. So today for me that would be my preferred choice if I had a choice, but I wouldn't feel extremely uncomfortable if I had to do one-off manipulation with sed occasionally. Personally I wouldn't use it for running (say) regular jobs, I would prefer a program in say Python, but that's just me, others would have other preferences.

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
<
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube