Line Editors in Linux, Tips and Tricks
I will log various ways through which tools like sed
, cut
and tr
can be used.
sed
😥
sed
😥Print specific lines from a file using line numbers.
Omit first line of output.
Omit last line of file.
Print everything after a pattern (inclusive).
Print everything before a pattern (inclusive).
Print everything between two patterns
Avoid printing the searched pattern
Insert contents of file after a certain line
Change line containing regex/pattern match
tr
➡️
tr
➡️Translate (or convert) all () to [] in a text file.
Translate all occurrences of multiple spaces with a single space.
Remove unwanted characters from string.
cut
✂️
cut
✂️Print every 4th word (or field) from a space separated STDIN.
I don't know about you but this is pretty cool.
awk
awk
Don't print first line of file
Resources & Learning Material
Last updated