Use regular expressions to help you. The egrep command should help as it allows you to use regular expressions.
You are looking for files like BOZO456 and BOZO123
Period . is a wild card that allows you to replace <anything> . * Allows you to repeat it 0 or more times. By placing around 123 and 456 parentheses, you will simulate OR.
Thus, you want any character to be repeated 0 or more times, then 123 or 456.
Example:
egrep "BOZO.*(456|123)" data
Thanks to Nathan Fellman for help and corrections.
digerati32
source share