Match two strings in one line with grep October 4, 2022 by Tarik You can use grep 'string1' filename | grep 'string2' Or grep 'string1.*string2\|string2.*string1' filename