N
N
Nikolai Novosad2017-03-11 14:21:09
bash
Nikolai Novosad, 2017-03-11 14:21:09

Lines that start or end with 'ta'?

Hello.
Need to find lines in the file that start or end with 'ta'.
Separately, I can do this:
1) starts: grep "^ta" file.txt
2) ends: grep "ta$" file.txt
But how to put it in one expression?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2017-03-11
@nik_neman

grep -P "(^ta|ta$)" test.txt

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question