Added grep snippets to check number of files matching a search term and snippet to check the number of MapReduce records processed.

This commit is contained in:
Donne Martin 2015-02-28 12:37:18 -05:00
parent 133cddb267
commit d28c32b8da

View File

@ -1,7 +1,7 @@
{
"metadata": {
"name": "",
"signature": "sha256:e595a63f61ca91bdd492a8932695aa68c3ef680260edee4cfe01574de3e4a431"
"signature": "sha256:8cd9b925468d91a5445fbecd65918d54988bc825d74728cb9bb0d22c193e03ed"
},
"nbformat": 3,
"nbformat_minor": 0,
@ -164,6 +164,47 @@
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Grep"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check number of files matching \u201c.txt\":"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"ls -1 | grep .txt | wc -l"
],
"language": "python",
"metadata": {},
"outputs": []
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Check number of MapReduce records processed, outputting the results to the terminal:"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"cat * | grep -c \"foo\" folder/part*"
],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}