I have a file a.txt,
one two
two one
my goal is to match the ‘one’ that is at the end of the sentence.
if it is opened in less (less a.txt
) , and manually searched by regex (/one$
),
as expected, it will match the ‘one’ in second line.
However if it is opened with,
less --pattern='one$' a.txt
,
opened file will match the both ‘one’s.
I also tried less '+/one$' a.txt
, which resulted in same outcome.