From 98e7aab5ce5c43920688f62229451a7303c5e79a Mon Sep 17 00:00:00 2001 From: Francesc Andreu Date: Mon, 3 Oct 2022 17:47:39 +0200 Subject: [PATCH] Day1_LAB Completed --- lorem-compressed.tar.gz | Bin 0 -> 1427 bytes lorem-copy/at.txt | 10 +++ lorem-copy/lorem.txt | 4 ++ lorem-copy/sed.txt | 9 +++ lorem-uncompressed/lorem-copy/at.txt | 10 +++ lorem-uncompressed/lorem-copy/lorem.txt | 4 ++ lorem-uncompressed/lorem-copy/sed.txt | 9 +++ lorem-uncompressed/lorem/at.txt | 10 +++ lorem-uncompressed/lorem/lorem.txt | 4 ++ lorem-uncompressed/lorem/sed.txt | 9 +++ solutions.ipynb | 91 +++++++++++++++--------- 11 files changed, 127 insertions(+), 33 deletions(-) create mode 100644 lorem-compressed.tar.gz create mode 100644 lorem-copy/at.txt create mode 100644 lorem-copy/lorem.txt create mode 100644 lorem-copy/sed.txt create mode 100644 lorem-uncompressed/lorem-copy/at.txt create mode 100644 lorem-uncompressed/lorem-copy/lorem.txt create mode 100644 lorem-uncompressed/lorem-copy/sed.txt create mode 100644 lorem-uncompressed/lorem/at.txt create mode 100644 lorem-uncompressed/lorem/lorem.txt create mode 100644 lorem-uncompressed/lorem/sed.txt diff --git a/lorem-compressed.tar.gz b/lorem-compressed.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..bd710b42768142c343b293b2200167361b74c2a6 GIT binary patch literal 1427 zcmV;E1#J2siwFP!000001MOMaZYwto^>cvygFe7b$BviBivkVM0!4wM=?BOfCMGZ% zO|%5*-}g`&Z$WO7yNqvv3?J-SM3LfhNYjn;WPhFvN)>3mTu!Q0HCr!dhwlSTW{d0D zYPni0*Q-f2t8hJ0%VE_jltR>AsmYz!tvQFl{}(mc|2kg9r#O@haqw!f_?-V|%j@OA z|MGk`yPmHnsv1h6WBTC!|0SwN@=lQpilWlSq@ZoeHw@c2${yr`+67HgD_4~dj<-s2^MUp8|Rfmz%`(m`3* zP>75xdNS0-mN^HM|jHN3tDGJ%w^s1=tFUTesP5(eORNs>;DiPS(hI zTHbP_*yg>(cFJ-KFFRnEeNJJ$rILr4~Kvue)D>P;*Bw1GwQy52Y~8G;6ISKc6K?5*e# z5dq%Ii!M?#T~GqPk!X8(v|=TIqpp?c~o=9 z!Ek#o_#{Y6H5e43NLav6fiwWF0XElyuBk^-+5;&ev+i5Ktsr#9(|?fOz+UVwXod^H z1#PE-FagOPqE7(jC-NpE2(mvRv8-`rZ&}2Fb3)6e++i`W0IFMP3RI2VmQ9zh|T76=(oxVUL{R>Gl@R0RgmwxW{iv}ZwxTqbhqqU29Y zSE*b&3J*?#vbC#P@2yq2Qa!6vSKs9SlK*h#fDPcA{oiV~%m3MRwUGXAv09D!e-8Q^ zX#^yg9a)m z5qhtN4H6@FTx4Cr7ZGHS^+t~ALo1XaPs(?@uklX0EV+;*k8%nDyv){P3dCWpAQ~UK zSXbI&pRtOLB?=3p8v=%cv#2LF0BWKm6uiSBZRy2iWpB+MnzP_n@Oioi=z>@$3Jch@ z(nZStEDa7$*CVzrko_uP+a9rP_7%={bgq|BT)zb4_5{Xpungq#YoNQU@GfPf0YJle0`sTnF17{Kl71QF^D#@Weds!m#E4F^d#MG- zj-v8AK`MfD=lkF~Ef1f5bizNQtou*Kb^i`G1p0#c&w5?u-~Y4uYMlR^gO2<^*bwN= z`afSh^Z$Il9{c~Z(DD4|=Jsg*gPZR%|9Ri|2hzTB{4><_2O6DDf8H_t0ndxWpP^?z zLydl3oBT+yeC^~1yfXN~*K30xy#D;)=asq7&FweNeLle0XHQ4?KiClH3+6w|#R`1_ zeg)3vBmSR*#`(`U|LOC8up!V}{oktE|NpmIFDvQ)7K`!!zq8Od{~6~$> lorem-copy/sed.txt" ] }, { @@ -230,7 +236,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: tail -3 lorem-copy/sed.txt" ] }, { @@ -246,7 +252,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: sed -i 's/et/ET/g' lorem-copy/at.txt" ] }, { @@ -262,7 +268,9 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "id : Gives uid, gid and groups\n", + "whoami : Givies name of active user" ] }, { @@ -278,7 +286,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: pwd" ] }, { @@ -294,7 +302,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: ls lorem/*.txt" ] }, { @@ -310,7 +318,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: wc -l lorem/sed.txt" ] }, { @@ -326,7 +334,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: find ~/OneDrive/Escritorio/D1LAB/lab-bash -type f -name 'lorem*' | wc -l" ] }, { @@ -342,7 +350,11 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "grep --color=auto \"et\" lorem/at.txt : only lower case et\n", + "grep -i --color=auto \"et\" lorem/at.txt : All of the et\n", + "\n", + "When using de -i parameter we count regardles of if the letter is lower or upper case." ] }, { @@ -358,7 +370,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "grep -o -i \"et\" lorem/at.txt | wc -l" ] }, { @@ -374,7 +387,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "grep -o -i \"et\" lorem/* | wc -l" ] }, { @@ -397,7 +411,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command:\n", + "name=Francesc" ] }, { @@ -413,7 +428,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command:\n", + "echo $name" ] }, { @@ -429,7 +445,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command:\n", + "mkdir $name" ] }, { @@ -445,7 +462,8 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command:\n", + "rmdir $name" ] }, { @@ -465,7 +483,10 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "for file in *; do echo ${#file}; done\n", + "\n", + "Run the prompt from the lorem directory." ] }, { @@ -484,7 +505,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: tasklist" ] }, { @@ -500,7 +521,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: cat /proc/cpuinfo" ] }, { @@ -532,7 +553,7 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: tar -zcvf lorem-compressed.tar.gz lorem lorem-copy" ] }, { @@ -548,7 +569,9 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command: \n", + "mkdir lorem-uncompressed\n", + "tar -xzvf lorem-compressed.tar.gz -C lorem-uncompressed" ] }, { @@ -564,7 +587,9 @@ "cell_type": "raw", "metadata": {}, "source": [ - "The command:" + "The command:\n", + "mkdir lorem-uncompressed\n", + "tar -xzvf lorem-compressed.tar.gz -C lorem-uncompressed" ] } ],