diff --git a/commands/linux.ipynb b/commands/linux.ipynb index 54a84da..3fa8a5c 100644 --- a/commands/linux.ipynb +++ b/commands/linux.ipynb @@ -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": {}