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
egrep -n '\bct\b' file1 > file2
By the way, grep -n selects lines together with line numbers. If that's not your intention then grep ct file1 > file2 would suffice.
grep ct file1 > file2