Things that are in my .zshrc but should be the default in every POSIX-compliant shell ever: fsgrep "*.h" "string"
Searches recursively through all subdirectories for files matching the pattern, then searches the files for a given string and reports where it found it and in which lines.

· · Web · 2 · 0 · 0

Wouldn't sth like

grep -r --include="$1" -n -i "$2"

do the same thing?

@Wolf480pl Kind of, but it lists the paths before each line, and I often deal with long paths.

@Wolf480pl Loses highlighting, and less is just less useful unless you're 100% committed to terminal-only use. And still keeps the paths up front.

--color=always |less -RS
but yeah yours is better

@lynne ahem, grep.

grep string **/*.h

** (recursive glob) is your friend.

@lynne Which I have just discovered bash doesn't like...

fish is cool with it though. Use that

Sign in to participate in the conversation

A Mastodon instance for people interested in multimedia, codecs, assembly, SIMD, and the occasional weeb stuff.