Answers for "how to check for a string in linux file"

2

linux test if string exists in file

if grep -Fxq "string" file.txt; then 
	echo "Match"
else 
	echo "No match"
fi
Posted by: Guest on January-28-2021
11

find string in files linux

grep -rnw '/path/to/somewhere/' -e 'pattern'
Posted by: Guest on January-23-2020

Code answers related to "how to check for a string in linux file"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language