In this example we will list players those contract is 2 years and age is 27. It’s useful and simple to use. I am trying to extract lines containing specific word from tabular file! If you want to display all lines that contain a sequence of four digits that is itself not part of any longer sequence of digits, one way is: grep -P '(?