Updated notebook to v3.

This commit is contained in:
Donne Martin 2015-06-03 13:45:42 -04:00
parent 84014940d9
commit c71f9d379a

View File

@ -1,12 +1,4 @@
{
"metadata": {
"name": "",
"signature": "sha256:7cdf1e36fef9e69cd9007eb0c5945e4d6440b31108bfddd6f19aa71d0d1a06ab"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "markdown",
@ -40,13 +32,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!df -h"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -57,13 +50,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -h ./"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -74,13 +68,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -sh ../"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -91,13 +86,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!du -csh ./"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -115,13 +111,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!wc -l < file.txt"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -132,13 +129,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!grep -c \".\" file.txt"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -149,13 +147,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!split -l 20 file.txt new"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -166,13 +165,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!split -l 802 -a 1 file.csv dir/part-user-csv.tbl-"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -185,18 +185,19 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"List number of files matching \u201c.txt\":"
"List number of files matching “.txt\":"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!ls -1 | grep .txt | wc -l"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -207,13 +208,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!cat * | grep -c \"foo\" folder/part*"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -224,13 +226,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"!sed -i '/Important Lines: /d\u2019 original_file"
],
"language": "python",
"metadata": {},
"outputs": []
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!sed -i '/Important Lines: /d original_file"
]
},
{
"cell_type": "markdown",
@ -241,8 +244,12 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Compress zip\n",
"!zip -r archive_name.zip folder_to_compress\n",
"\n",
@ -269,10 +276,7 @@
"\n",
"# Uncompress all tar.gz in current directory to another directory\n",
"!for i in *.tar.gz; do echo working on $i; tar xvzf $i -C directory/ ; done"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -283,8 +287,12 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Display the curl output:\n",
"!curl donnemartin.com\n",
"\n",
@ -308,10 +316,7 @@
"\n",
"# Authenticate -u\n",
"!curl -u username:password url"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -322,8 +327,12 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"# Display sorted info about processes\n",
"!top\n",
"\n",
@ -338,10 +347,7 @@
"\n",
"# Display running processes as a tree\n",
"!pstree"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -359,16 +365,17 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"export PS1='\\[\\033[01;32m\\]\\u@\\h\\[\\033[00m\\]:\\[\\033[01;34m\\]\\W\\[\\033[00m\\]\\$ '\n",
"export CLICOLOR=1\n",
"export LSCOLORS=ExFxBxDxCxegedabagacad\n",
"alias ls='ls -GFh'"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -379,13 +386,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!source ~/.bash_profile"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -396,8 +404,12 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"Normal mode: esc\n",
"\n",
"Basic movement: h, j, k, l\n",
@ -427,10 +439,7 @@
"\n",
"Quit without saving changes: q!\n",
"Write the current file and quit: :wq"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -441,13 +450,14 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!vimtutor"
],
"language": "python",
"metadata": {},
"outputs": []
]
},
{
"cell_type": "markdown",
@ -458,20 +468,39 @@
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"execution_count": null,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"!cd ~\n",
"!vim .vimrc\n",
"# Add the following to ~/.vimrc\n",
"syntax on\n",
":wq"
],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.9"
}
},
"nbformat": 4,
"nbformat_minor": 0
}