In my case I want to grep lines which have number 4 in fourth column. Fourth column is last column. Columns are separated with space. I have this command:
grep -P '^([^\s]*\s){3}4
But that greps lines which contains nubers which strats with 4 like for example: 45, 4768, but I want that this works only for number 4.
That just doesn't work:
grep -P '^([^\s]*\s){3}4\n