"howdoi" is a python utility we can install via pip: sudo pip install howdoi https://github.com/gleitz/howdoi Exsample: $> howdoi -n 5 grep bash # Answer from https://stackoverflow.com/questions/3052867/bash-script-using-grep-to-search-for-a-pattern-in-a-file ★ $pattern ================================================================================ # Answer from https://stackoverflow.com/questions/19819221/how-to-use-grep-in-a-shell-script-to-find-a-word-inside-of-a-file ★ grep -F "$word1" "$filename" ================================================================================ # Answer from https://stackoverflow.com/questions/12444808/how-do-i-fetch-lines-before-after-the-grep-result-in-bash ★ grep -i -B 10 'error' data ================================================================================ # Answer from https://stackoverflow.com/questions/19447352/using-grep-inside-shell-script-gives-file-not-found-error ★ #!/usr/bin/env bash test=$(grep 'foo' "$1") echo "$test" ================================================================================ # Answer from https://stackoverflow.com/questions/18147884/shell-variable-in-a-grep-regex ★ $ string="test this" $ var="test" $ echo $string | grep "^$var"