I want to copy lines containing certain words from file1 to file2.
file1
file2
Suppose file1:
ram 100 ct 50 gopal 200 bc 40 ra
awk '$3=="ct"' file1 > file2
This only filters lines where the third column must exactly match the string ct.
ct