Skip to content

Instantly share code, notes, and snippets.

@hongsolo9
Last active July 28, 2022 00:44
Show Gist options
  • Save hongsolo9/14eae896d5781c9432a3042a37ac9325 to your computer and use it in GitHub Desktop.
Save hongsolo9/14eae896d5781c9432a3042a37ac9325 to your computer and use it in GitHub Desktop.
Using sed, remove lines starting with "20220726" or "20220727" or "No"
# -i : inplace editing
# ^ : line starting with
# | : or (here we put a \| because "|" is a special character)
sed -i '/^20220727\|^20220726\|^No/!d' <filename>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment