grep -qxF 'your text "additional text"' yourfile.txt || echo 'your text "additional text"' >> yourfile.txt
Related
See also
ack, ag, grep
, egrep, fgrep
, agrep
, ngrep
, pgrep
, awk
, sed
, strings
, tr
, tail
, mtail
, git grep
, wc
, uniq
, LogQL
, findstr (Windows)
, rg, git-grep, cut