---
title: "💭 Deleting Specific Lines in a File with sed or yq"
description: "!https://nickjanetakis.com/blog/deleting-specific-lines-in-a-file-with-sed-or-yq"
date: 2023-07-28
published: true
tags:
  - linux
  - bash
  - cli
  - thought
template: link
---


<div class="embed-card embed-card-external">
  <a href="https://nickjanetakis.com/blog/deleting-specific-lines-in-a-file-with-sed-or-yq" class="embed-card-link" target="_blank" rel="noopener noreferrer">
    <div class="embed-card-image">
      <img src="https://nickjanetakis.com/assets/blog/cards/deleting-specific-lines-in-a-file-with-sed-or-yq.jpg" alt="Deleting Specific Lines in a File with sed or yq — Nick Janetakis — We" loading="lazy">
    </div>
    <div class="embed-card-content">
      <div class="embed-card-title">Deleting Specific Lines in a File with sed or yq — Nick Janetakis</div>
      <div class="embed-card-description">We</div>
      <div class="embed-card-meta">Nick Janetakis &middot; nickjanetakis.com</div>
    </div>
  </a>
</div>


sed can be a tricky beast, I often stumble when trying to pipe into it.  Next time I need to use sed, I should reference this article by Nick Janetakis.  He makes it looks much easier than my experience has been, and it appears to behave like a vim `:%s/` substitution does, or a `g/` g command.

!!! note

    This post is a <a href="/thoughts/" class="wikilink" data-title="Thoughts" data-description="These are generally my thoughts on a web page or some sort of url, except a rare few don&#39;t have a link. These are dual published off of my..." data-date="2024-04-01">thought</a>. It's a short note that I make
    about someone else's content online <a href="/tags/thoughts/" class="hashtag-tag" data-tag="thoughts" data-count=2 data-reading-time=3 data-reading-time-text="3 minutes">#thoughts</a>
