From 5adfb25180692876937e0b0b692271a598aba0da Mon Sep 17 00:00:00 2001 From: sborto86 Date: Mon, 3 Oct 2022 17:47:12 +0200 Subject: [PATCH 1/3] Sergi Portoles labdata --- lorem-copy/at.txt | 10 +++++ lorem-copy/lorem.txt | 4 ++ lorem-copy/sed.txt | 9 ++++ solutions.ipynb | 103 ++++++++++++------------------------------- 4 files changed, 51 insertions(+), 75 deletions(-) create mode 100644 lorem-copy/at.txt create mode 100644 lorem-copy/lorem.txt create mode 100644 lorem-copy/sed.txt diff --git a/lorem-copy/at.txt b/lorem-copy/at.txt new file mode 100644 index 0000000..1d60356 --- /dev/null +++ b/lorem-copy/at.txt @@ -0,0 +1,10 @@ +At vero eos ET accusamus ET iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum +deleniti atque corrupti quos dolores ET quas molestias excepturi sint occaecati cupiditate non +provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum ET dolorum fuga. +Et harum quidem rerum facilis est ET expedita distinctio. +Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod +maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. +Temporibus autem quibusdam ET aut officiis debitis aut rerum necessitatibus saepe eveniET +ut ET voluptates repudiandae sint ET molestiae non recusandae. +Itaque earum rerum hic tenETur a sapiente delectus, ut aut reiciendis voluptatibus maiores +alias consequatur aut perferendis doloribus asperiores repellat \ No newline at end of file diff --git a/lorem-copy/lorem.txt b/lorem-copy/lorem.txt new file mode 100644 index 0000000..3d79369 --- /dev/null +++ b/lorem-copy/lorem.txt @@ -0,0 +1,4 @@ +Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. +Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. +Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. +Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. \ No newline at end of file diff --git a/lorem-copy/sed.txt b/lorem-copy/sed.txt new file mode 100644 index 0000000..1e83d2b --- /dev/null +++ b/lorem-copy/sed.txt @@ -0,0 +1,9 @@ +Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, +totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo. +Nemo enim ipsam voluptatem quia voluptas sit aspernatur aut odit aut fugit, +sed quia consequuntur magni dolores eos qui ratione voluptatem sequi nesciunt. +Neque porro quisquam est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, +sed quia non numquam eius modi tempora incidunt ut labore et dolore magnam aliquam quaerat voluptatem. +Ut enim ad minima veniam, quis nostrum exercitationem ullam corporis suscipit laboriosam, +nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in ea voluptate velit esse quam nihil molestiae consequatur, +vel illum qui dolorem eum fugiat quo voluptas nulla pariatur?homini lupus diff --git a/solutions.ipynb b/solutions.ipynb index 10ae56f..4e5356d 100644 --- a/solutions.ipynb +++ b/solutions.ipynb @@ -22,7 +22,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "echo 'Hello World'" ] }, { @@ -38,7 +38,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "mkdir new_dir" ] }, { @@ -54,55 +54,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "lang": "en" - }, - "source": [ - "#### Print Hello World to console." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "The command:" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "lang": "en" - }, - "source": [ - "#### Create a new directory called new_dir." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "The command:" - ] - }, - { - "cell_type": "markdown", - "metadata": { - "lang": "en" - }, - "source": [ - "#### Delete that directory." - ] - }, - { - "cell_type": "raw", - "metadata": {}, - "source": [ - "The command:" + "rm new_dir -d" ] }, { @@ -118,7 +70,9 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "mkdir lorem-copy\n", + "cd lorem\n", + "cp lorem.text ../lorem-copy" ] }, { @@ -134,7 +88,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "cp at.txt lorem.txt ../lorem-copy" ] }, { @@ -150,7 +104,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "cat sed.txt" ] }, { @@ -166,7 +120,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "cat at.txt\n", + "cat lorem.txt" ] }, { @@ -182,7 +137,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "head -n 3 ../lorem-copy/sed.txt" ] }, { @@ -198,7 +153,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "tail -n 3 ../lorem-copy/sed.txt" ] }, { @@ -214,7 +169,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "echo 'homini lupus' >> sed.txt" ] }, { @@ -230,7 +185,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "tail -n 3 sed.txt" ] }, { @@ -246,7 +201,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "sed -i s/'et'/'ET'/g at.txt" ] }, { @@ -262,7 +217,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "who -u" ] }, { @@ -278,7 +233,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "pwd" ] }, { @@ -294,7 +249,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "ls *.txt" ] }, { @@ -310,7 +265,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "wc -w ../lorem/sed.txt " ] }, { @@ -326,7 +281,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "find */lorem* | wc -l" ] }, { @@ -342,7 +297,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "grep 'et' ./lorem/at.txt\n" ] }, { @@ -358,7 +313,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "grep 'et' ./lorem/at.txt | wc -l" ] }, { @@ -374,7 +329,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "grep 'et' ./lorem-copy/*.* | wc -l" ] }, { @@ -397,7 +352,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "name='Sergi'" ] }, { @@ -413,7 +368,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "echo $name" ] }, { @@ -429,7 +384,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "mkdir $name" ] }, { @@ -445,7 +400,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "rm $name -d" ] }, { @@ -464,9 +419,7 @@ { "cell_type": "raw", "metadata": {}, - "source": [ - "The command:" - ] + "source": [] }, { "cell_type": "markdown", From 8cee2b976d1a7c9f2655a048d7eb2f47cf3e12c4 Mon Sep 17 00:00:00 2001 From: sborto86 Date: Mon, 3 Oct 2022 23:47:21 +0200 Subject: [PATCH 2/3] Second verison of the tasks --- solutions.ipynb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/solutions.ipynb b/solutions.ipynb index 4e5356d..ad697b3 100644 --- a/solutions.ipynb +++ b/solutions.ipynb @@ -104,7 +104,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "cat sed.txt" + "cat ./lorem/sed.txt" ] }, { @@ -419,7 +419,11 @@ { "cell_type": "raw", "metadata": {}, - "source": [] + "source": [ + "for file in ./lorem/*; do cat $file; done\n", + "for file in ./lorem/*; do echo `basename \"$file\" .txt`|wc -m; done\n", + "for file in ./lorem/*; do name=`basename \"$file\" .txt`; text=$name; text+=\" has \";text+=${#count}; text+=\" characters long\"; echo $text; done" + ] }, { "cell_type": "markdown", @@ -437,7 +441,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "\"No htop or top command in git dash for windows\"\n", + "ps -ae" ] }, { @@ -453,7 +458,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "wmic cpu list brief\n", + "wmic desktopmonitor" ] }, { From 12187e20f67a3a2c99c33c4cc1f3f4f41980b5f8 Mon Sep 17 00:00:00 2001 From: sborto86 Date: Tue, 4 Oct 2022 00:32:38 +0200 Subject: [PATCH 3/3] Final version of the task --- solutions.ipynb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solutions.ipynb b/solutions.ipynb index ad697b3..e186b30 100644 --- a/solutions.ipynb +++ b/solutions.ipynb @@ -475,7 +475,10 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "nano .bash_profile\n", + "alias dir=\"ls\"\n", + "alias clear=\"ls\"\n", + "alias unzip=\"tar -xf\"" ] }, { @@ -491,7 +494,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "tar -cvzf lorem-compressed.tar.gz lorem-copy" ] }, { @@ -507,7 +510,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "tar -xf lorem-compressed.tar.gz -C ./lorem-uncompressed/" ] }, {