📌  相关文章
📜  bash 检查文件中是否有字符串 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:03.390000             🧑  作者: Mango

代码示例2
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