Lecture 4. Shells. Pattern Matching

Lecture 4. Download here a summary of what I presented in calss + some more "theoretical" notes. Below is some additional info + hands on examples we did in calss.


Commands and the shell


Searching within files


More subtle differences


Learning to grep


Egrep examples

Important: make sure you are using egrep and not just grep . The latter does not understand some of the extended regular expressions we will be using. If you want to make sure you always use egrep just alias grep 'egrep'

Assume you are given the file sample.txt. You can do cat -n sample.txt (so that you can see the line numbers). Let's do some pattern matching now.

Return Home