Answers for "grep search in file bash"

2

shell script search from file content

grep 'word' filename
grep 'word' file1 file2 file3
grep 'string1 string2'  filename
cat otherfile | grep 'something'
command | grep 'something'
command option1 | grep 'data'
grep --color 'data' fileName
Posted by: Guest on March-07-2020
-1

grep string in file

if grep -Fxq "pattern_to_search" file.txt; then #check if pattern string in file
  #do something
fi
Posted by: Guest on November-02-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language