3 ms·
$ cat ~/bin/f #!/bin/bash if [ "$1" != "" ] ; then find . -type f | grep -v '\.git' | grep -i "$1" else find . -type f | grep -v '\.git'
by ramses0 3y ago
$ 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
- oxygen_crisis 3y agoPiping `find` through `grep` like that is inefficient, find has robust filtering capabilities you can use without the overhead of spawning subshells with pipes and calling another binary like grep. find . -type f -not -path '*/.git/*' -name "*$1*"
- ramses0 3y agoHrm... `f foo` vs. `.............................................foo..`