by gumby · 2y ago · 0 comments
I’ve been using `history | grep` since forever (usually `history | grep foo | tail -n 5` which has been a single-character alias for more than 30 years). Hard to beat. Since history gives you the line number you can just `!12345` — no need to copy/paste, and works through an ssh connection!
But just to be clear: I didn’t at all write “surprised” as some polite euphemism for “this is dumb”. Clearly people have found it useful for a while and it’s harmless easy for me to collect some empirical data, so I just installed it. Might turn out to be a big win.
I have "history | grep" basically aliased to "h?"
I’ve decided to end sentances with two to try to avoid their ire..
$ cat ~/bin/f
#!/bin/bash
if [ "$1" != "" ] ; then
find . -type f | grep -v '\.git' | grep -i "$1"
else
find . -type f | grep -v '\.git'
fi find . -type f -not -path '*/.git/*' -name "*$1*"