Last active
December 28, 2015 07:39
-
-
Save takeshixx/7466377 to your computer and use it in GitHub Desktop.
$shell (zsh,bash,etc.) search functions
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
# search all with wildcard | |
function saw(){ | |
find / -regextype posix-extended -iregex ".*\/[^\/]*$@.*" -exec ls -lad --color {} \; 2>/dev/null | |
} | |
# search all with exact match | |
function sa(){ | |
find / -regextype posix-extended -iregex ".*\/$@" -exec ls -lad --color {} \; 2>/dev/null | |
} | |
# search local with wildcard | |
function slw(){ | |
find . -regextype posix-extended -iregex ".*\/[^\/]*$@.*" -exec ls -lad --color {} \; 2>/dev/null | |
} | |
# search local with exact match | |
function sl(){ | |
find . -regextype posix-extended -iregex ".*\/$@" -exec ls -lad --color {} \; 2>/dev/null | |
} | |
# show which files contain a keyword | |
function gg(){ | |
grep -isl $@ * | |
} | |
# show which files contain a keyword (recursively) | |
function ggr(){ | |
grep -risl $@ * | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment