diff --git a/solutions.ipynb b/solutions.ipynb index 10ae56f..df898ad 100644 --- a/solutions.ipynb +++ b/solutions.ipynb @@ -22,7 +22,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: echo \"Hello World\"" ] }, { @@ -38,7 +38,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: mkdir new_dir" ] }, { @@ -54,7 +54,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: rm -r new_dir/" ] }, { @@ -70,7 +70,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: echo \"Hello World\"" ] }, { @@ -86,7 +86,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: mkdir new_dir" ] }, { @@ -102,7 +102,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: rm -r new_dir/" ] }, { @@ -118,7 +118,9 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "mkdir lorem-copy\n", + "cp lorem/sed.txt lorem-copy" ] }, { @@ -134,7 +136,16 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: cp lorem/at.txt lorem-copy ; cp lorem/lorem.txt lorem-copy" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "Other option: cp lorem/{at.txt,lorem.txt} lorem-copy" ] }, { @@ -150,7 +161,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: cat lorem/sed.txt" ] }, { @@ -166,7 +177,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: cat lorem/{at.txt,lorem.txt}" ] }, { @@ -182,7 +193,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: head --lines=3 lorem-copy/sed.txt" ] }, { @@ -198,7 +209,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: tail --lines=3 lorem-copy/sed.txt" ] }, { @@ -214,7 +225,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: echo \"Homo homini lupus\" >> lorem-copy/sed.txt" ] }, { @@ -230,7 +241,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: tail --lines=3 lorem-copy/sed.txt" ] }, { @@ -246,7 +257,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: sed -i -e 's/et/ET/g' lorem-copy/at.txt" ] }, { @@ -262,7 +273,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: whoami" ] }, { @@ -278,7 +289,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: pwd" ] }, { @@ -294,7 +305,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: cd lorem ; ls *.txt" ] }, { @@ -310,7 +321,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: wc -l lorem/sed.txt" ] }, { @@ -326,7 +337,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: find . -name \"lorem*\" -type f | wc -l" ] }, { @@ -342,7 +353,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: grep --color=always \"et\" lorem/at.txt" ] }, { @@ -358,7 +369,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: grep -o \"et\" lorem/at.txt | wc -l" ] }, { @@ -374,7 +385,24 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: grep -roh -i \"et\" lorem-copy/ | wc -l" + ] + }, + { + "cell_type": "raw", + "metadata": {}, + "source": [ + "The command: grep -roh \"et\" lorem-copy/ | wc -l" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# The first one considers the capitalized ET in at.txt (-i ignores case)\n", + "# The second one only considers \"et\"" ] }, { @@ -397,7 +425,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: name=\"marc\"" ] }, { @@ -413,7 +441,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: echo $name" ] }, { @@ -429,7 +457,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: mkdir $name" ] }, { @@ -445,7 +473,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: rm -r marc/" ] }, {