Noob Question Thread: Ask Any Questions About Linux!

Cyclohexane@lemmy.mlmod to Linux@lemmy.ml – 314 points –

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!

447

You are viewing a single comment

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 of greps 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