I'm writing a command to find broken Cygwin symlinks. Right now, I'm using:egrep -rnw . -e ^\!<symlink>But this isn't very efficient. I only care if the file starts with !<symlink>, but grep will keep searching the rest of the file.Is there any way I can efficiently search files by content prefix?
Quickly find all files that start with a given string
grep