Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • 13
    I find sed is much easier to learn though, so you need to account for that. As you learn to master awk, it might be useful to quickly learn sed to be able to use it faster for things you might not know how to do in awk yet.
    – Didier A.
    Commented May 7, 2016 at 8:03
  • 39
    Don't ditch sed, 's/search/replace' is way easier to type than awk's syntax and is what you need most of the time.
    – sjas
    Commented Jun 4, 2017 at 12:10
  • 2
    Better to use a mixture. For instance, if you are looking for a pattern in a huge file, use grep to find the line number, and then sed to edit the line. Otherwise, sed is going to be much slower to process the entire file.
    – Konchog
    Commented Oct 30, 2018 at 11:27
  • 3
    If you're a craftsman, you learn how to use all your tools and you'll know which to use when. If you're just fixing stuff, a hammer and a screwdriver might just be all you need.
    – pbarney
    Commented Jan 12, 2021 at 17:20