In this video, you'll learn about AWK.
AWK is a powerful text processing utility
that is specialized in data extraction and reporting.
And it can perform actions that are based on selectors.
It's an ancient utility that was developed
in a time where computers didn't have a screen,
and it was important to address specific lines.
And as such, it contains a lot of functionality
that is not really needed anymore.
But I do have a couple of examples
that can be quite convenient.
Let me show you.
So to start with AWK minus uppercase F colon.
That's another way to specify that the colon is
the field separator.
And then print $4 in ETC pass WD.
And there we can see the fourth field in ETC pass WD.
And in case you think, how is that
different from what I can do with CUT?
Well, AWK is better in recognizing different fields.
And also, between the single quotes,
you can put complex criteria like AWK minus F colon
slash Linda slash, which is searching for lines
that contain the text Linda.
And there we are printing the fourth field.
So that is allowing you to show a specific property
if on beforehand you know where this property is.
And what do you think of the colon NF?
Colon NF is for the last field.
That can be quite convenient as well, because in some cases,
you never know how many fields there are in a line.
But if you are sure that you are only
interested in the last field, well,
print $NF is going to help you with that.
Now, these are the three AWKs examples that I like a lot.
And I think it's sufficient if you know how to use them,
particularly the second one, where
you are filtering for specific text.
That is pretty AWKSome.