📅  最后修改于: 2022-03-11 14:51:48.482000             🧑  作者: Mango
Just use grep with flags 'F' (fixed string), 'x' (exact match) and 'q'
(quiet output) in order to check if a word string is in a file
if ! grep -Fxq "string" file.txt; then #do some code...#; fi