#!/bin/bash find_notdot() { where="$1" shift find "$where" -path '*/.*' -prune -or "$@" -print0 } grrep() { dir="$1" ; shift find_notdot "$dir" -type f | tr -d '\r\n' | xargs -0 -r grep "$@" } for d in "${@:-.}"; do find_notdot "$d" -name '*?~?*' grrep "$d" -l -e '^<<<<<<< ' # -e '^=======$' -e '^>>>>>>> ' done