I'm looking to use grep(or egrep) to find two words that are on the same line. ONT and MONDAY
Flight# Airline Depart Arrive Day
------------------------------------------
93104 TEAM ONT LAX MONDAY
62876 GE NYC ONT THURSDAY
30118 LOGI ONT PHX FRIDAY
12033 F LAX PHX MONDAY
40990 ACTI PHX ONT MONDAY
92377 EA ONT PHX SUNDAY
I've tried various commands but every line that has MONDAY or ONT are returned instead of line with flight #93104
awk '$3=="ONT" && $5=="MONDAY"'
i.e. match specific strings in specific columns – steeldriver Oct 20 '19 at 00:32