awk command to find if any one argument is matching
What is the command to find out the lines having a certain word in it.
I have given a command : awk '{if($1=="ashok")print}' awk.txt here awk.txt is a file containing differnet lines. how i amend this command to get every line printed having ashok in any column like awk.txt file line1--> ashok mehera 23 line2--> mittal ashok 25 line3--> anand goyal 34 so from the above command only will print line 1 instead i want that both line 1 and line 2 should be printed. |
Hi,
awk '/ashok/ { print }' awk.txt should work. All between / and / is what awk is lookin for in a line, if it finds a hit, the line is printed. Hope this helps. |
Quote:
Thanks Buddy it works efficiently |
All times are GMT -5. The time now is 09:50 AM. |