Hello How can I grep only match before : mark?
:
If I run grep test1 file, it shows all three lines.
grep test1 file
test1:x:29688:test1,test2 te
I think that you just need to add “:” after “test1”, see an example:
grep “test1:” file