Last active
June 21, 2023 11:23
-
-
Save verityj/1baf59b95a7da5f03a44ce0620a4253d to your computer and use it in GitHub Desktop.
Shell script: search everywhere for a string (not case sensitive) - do not show errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
# Written by: VerityJ | |
# Published on: https://gist.github.com/verityj | |
# | |
# Usage: ./find-all.sh search-string | |
# search-string does not need " or * | |
if [ -z "$1" ] | |
then | |
echo "Usage: ./find-all.sh search-string (note: no need for \" or *)" | |
exit 0 | |
fi | |
printf "\nSearching everywhere for \"*$1*\" (case-insensitive) ...\n\n" | |
find / -iname "*$1*" -not -path "/System/Volumes/Data/*" -print 2>/dev/null |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Option: copy this script into
/usr/local/bin
. You may rename itmv find-all.sh find-all
.In that case, from anywhere in the system, you can type: