Skip to content

Instantly share code, notes, and snippets.

@minrk
Created March 23, 2018 14:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save minrk/220dba2b1d7be2c3da8a32efc5ace01d to your computer and use it in GitHub Desktop.
Save minrk/220dba2b1d7be2c3da8a32efc5ace01d to your computer and use it in GitHub Desktop.
Display the source blob
Display the rendered blob
Raw
{
"cells": [
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "%%writefile test.txt\nfoo bar\nbarman\nbaz",
"execution_count": 32,
"outputs": [
{
"output_type": "stream",
"text": "Overwriting test.txt\n",
"name": "stdout"
}
]
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "!grep bar test.txt",
"execution_count": 33,
"outputs": [
{
"output_type": "stream",
"text": "foo bar\r\nbarman\r\n",
"name": "stdout"
}
]
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "%alias grep grep --color=always",
"execution_count": 34,
"outputs": []
},
{
"metadata": {
"trusted": true
},
"cell_type": "code",
"source": "grep bar test.txt",
"execution_count": 35,
"outputs": [
{
"output_type": "stream",
"text": "foo \u001b[01;31m\u001b[Kbar\u001b[m\u001b[K\r\n\u001b[01;31m\u001b[Kbar\u001b[m\u001b[Kman\r\n",
"name": "stdout"
}
]
}
],
"metadata": {
"kernelspec": {
"name": "python2",
"display_name": "Python 2",
"language": "python"
},
"language_info": {
"mimetype": "text/x-python",
"nbconvert_exporter": "python",
"name": "python",
"pygments_lexer": "ipython2",
"version": "2.7.14",
"file_extension": ".py",
"codemirror_mode": {
"version": 2,
"name": "ipython"
}
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment