I thought I’ll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!
I’ll try my best to answer any questions here, but I hope others in the community will contribute too!
I thought I’ll make this thread for all of you out there who have questions but are afraid to ask them. This is your chance!
I’ll try my best to answer any questions here, but I hope others in the community will contribute too!
This is 80% of my usage of awk and sed:
“ugh, I need the 4th column of this print out”:
command | awk '{print $4}'
Useful for getting pids out of a
ps
command you applied a bunch ofgrep
s to.”hm, if I change all ‘this’ to ‘that’ in the print out, I get what I want":
command | sed "s/this/that/g"
Useful for a lot of things, like “I need to change the urls in this to that” or whatever.
Basically the rest I have to look up.
I say that covers around 99% of the awk/sed I use.
I was gonna write 99%, but then I remember I also need capture groups quite often. That would make 99% I’d say