I want to know how to quickly delete text with Bash. For example, I have a file named file.txt with a total of 500 lines.
I want to delete lines 80 to 146 - how do I do that?
What's is a terminal command that can do that?
I want to know how to quickly delete text with Bash. For example, I have a file named file.txt with a total of 500 lines.
I want to delete lines 80 to 146 - how do I do that?
What's is a terminal command that can do that?
If this is one time I would use vi or vim
That last one saves and quits. Using sed:
Make a backup if unsure so you can revert.
With
awk
to print in terminal:Or with
gawk
to edit file in-place: