📌  相关文章
📜  linux 测试文件中是否存在字符串 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:51:48.482000             🧑  作者: 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