Answers for "linux check line exist in 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
1

linux check line exist in file

[ grep -Fxq "string" file.txt ] || echo "not found"
Posted by: Guest on March-21-2022

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language