Length: 00:07:38

Lesson Summary:

We know how to match individual characters and tokens, but what about when we want to define our match by where in the file the match is located? This is were location match tokens such as ^ and $ come in. These metacharacters allow us to define whether our match comes at the beginning of a line, the end of a line, or both. In this lesson, we use grep to demonstrate the matching capability of this token, then learn a more practical example where we remove blank lines from a file using sed in combination with our location-based regex.

Get the lesson files here!:

This lesson is only available to Linux Academy members.

Sign Up To View This Lesson
Or Log In

Looking For Team Training?

Learn More