KEYWORDS=(dolphins fish dogs cats iguanas)IFS=$'\n'find . -type f -size +1c ! -exec grep -qF ${KEYWORDS[*]} {} \; -exec truncate -s 0 -f {} \;If a file is over 1 byte, search for keywords. If keyword is not found, truncate it to 0 bytes. I get the following error:truncate: invalid option -- 'f'Try `truncate --help' for more information.
Using wget and grep to download HTML pages and filter by keywords
linux;grep;wget