From the course: Linux Tips

Unlock this course with a free trial

Join today to access over 22,500 courses taught by industry experts.

Working with text: AWK

Working with text: AWK - Linux Tutorial

From the course: Linux Tips

Working with text: AWK

- [Instructor] AWK is a programming language that allows us to manipulate text. On a Linux system we can us mawk, or AWK which is assimilant to AWK. In order to run AWK programs on text, like the said tool, AWK is commonly used in pipelines of commands to extract and transform text quickly and easily. But let's take a look at it here by itself at the command line. I have a little text file that I'm working with. You can create one if you'd like or use some other text that's available on your system. I'll start out with AWK and then I'll set up a little space to write my program. I'll do that with a set of single quotes and inside that a set of curly braces. Some AWK programs don't require the braces, but we'll start out with them. In here I'll use the print command. Which takes some information from the input and returns it to the output and I'll use dollar sign one here to represent the first field per line in the input file. Then the file with a few lines of text in it. So what…

Contents