Improve skills in doing text based search queries on the local disk.
grep, egrep, fgrep, git grep, find
-
Brainstorming session
What 'search' skills would I like to improve?
-
Challenges
Format:
N. (search-file | directory)
q: challenge description
r: description of expected result
Set-up:
git clone https://github.com/cclug/grep-session
git clone https://github.com/spf13/cobra
Challenge results based on cobra commit hash
0dacccfbaabc71b872087c1719c5380d3e185173
-
patch.mbox
q: Who sent the patch? r: Single line containing name and email address.
-
patch.mox
q: List all lines that include an email address. r: 48 lines, a bunch of false positives.
-
cobra/
q: All files that mention the function
OnInitialize
r:README.md cobra.go cobra/cmd/init.go cobra/cmd/root.go cobra/cmd/testdata/root.go.golden
-
patch.mbox
q: Return the email sender (not the mailing list) and the subject. r: Two lines.
-
patch.mbox
q: All the lines added to the code by the patch i.e starting with a plus symbol. r: 2632 lines.
-
cobra
q: List all lines containing function definitions that include
string
in the parameter list. r: 205 lines.
-
patch.mbox
q: What is the email address of the patch author. r: Just the email address.
-
patch.mbox
q: Extract all the email address from the patch. r: ?
-
cobra/cobra/
q: Extract a list of all function names from the source code. r: ?