This file contains hidden or 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
$ time cat sample_data/* | ./go_mapper | ./go_reducer | |
cat sample_data/* 0,02s user 0,52s system 5% cpu 10,299 total | |
./go_mapper 6,33s user 3,65s system 95% cpu 10,299 total | |
./go_reducer 3,27s user 3,02s system 59% cpu 10,335 total | |
$ time cat sample_data/* | \ | |
awk '{print $7}' | sort | uniq -c | \ | |
awk '{ x[$2] += $1 } END { for (w in x) { print x[w] " " w } }' | \ | |
sort -rn | sed 20q | |
cat sample_data/* 0.01s user 0.19s system 0% cpu 26.875 total |
This file contains hidden or 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
tr -cs A-Za-z '\n' | \ | |
tr A-Z a-z | \ | |
sort | \ | |
uniq -c | \ | |
sort -rn | \ | |
sed ${1}q |
This file contains hidden or 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
git log --all --pretty=format:%cN | sort | uniq | while read ll; do git log --all --since=2.days.ago --pretty=format:%h//%cN//%s//%ad --no-merges | awk -F// '{print "- " $2 " worked on " $3 " (" $1 ")" }' | egrep "$ll"; done |
This file contains hidden or 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
#even better | |
git log --all --since=2.days.ago --pretty=format:%h//%cN//%s//%ad | egrep -v -i 'merge branch' | awk -F// '{print $4 " " $1 "\t" substr($2,0,7) "\t " $3}' |
This file contains hidden or 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
awk '{pages += $3; bytes += $4} END {print pages, bytes}' pagecounts-20140501-110000 | awk '{gtp += $1; gtb += $2} END {print "Total # of Pages: " gtp, "Total # of Bytes requested: " gtb}' |
This file contains hidden or 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
grep -c ruby *.txt | sed 's/.*:/ /' | awk '{total += $1} END {print total}' |
This file contains hidden or 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
find *.txt | while read fn; do ./indexone.sh $fn ; done | awk -f indexmerge.awk | sort | head -10 |
This file contains hidden or 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
find . -name "*.txt" -ls | awk '{total += $7} END {print total/1000000 " MB"}' |
This file contains hidden or 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
curl https://us-east.manta.joyent.com/manta/public/examples/shakespeare/ | egrep -o '"name":.*?[^\\]",' | sed 's/"name":/ /' | awk '{print $1}' | tr -d '"|,' |
This file contains hidden or 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
cat *.txt | tr -cs A-Za-z '\n' | tr A-Z a-z | sort | uniq -c | awk '{ x[$2] += $1 } END { for (w in x) { print x[w] " " w } }' | sort -rn | head -10 |