How to grep lines having specific format


How to grep lines having specific format



I have got a file with following format.

1234, 'US', 'IN',...... 324, 'US', 'IN',...... ... ... 53434, 'UK', 'XX', .... ... ... 253, 'IN', 'UP',.... 253, 'IN', 'MH',.... 

Here I want to extract only those lines having 'IN' as 2nd keyword. i.e.

253, 'IN', 'UP',.... 253, 'IN', 'MH',.... 

Can any one please tell me a command to grep it.




Methods of sending web-generated config files to servers and restarting services

1:



Linux / Ubuntu command similar to Windows cmd “start”?


How to capture any key in X?


how to detect lines of code with regex in VIM

2:



On linux, how to check if port is in listen state without trying to connect
This works:.
Invalid argument in sendfile() with two regular files
egrep "^[0-9]+, 'IN'" 



74 out of 100 based on 19 user ratings 544 reviews

*