From 8f666bbec987440a1dea91ad0eaa1aa1c36bfcf4 Mon Sep 17 00:00:00 2001 From: liyapaul24 Date: Wed, 21 Aug 2024 18:56:45 -0400 Subject: [PATCH 1/5] Update assignment.sh : added answer for Qn1 As part of DSI cohort4 assignment --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 27d7034b..e749bf07 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -8,6 +8,7 @@ set -x # > Add your code below each comment to complete the tasks # 1. Create 5 directories named dir1, dir2, dir3, dir4, and dir5 +mkdir dir1 dir2 dir3 dir4 dir5 # 2. List the contents of the parent directory to verify the presence of the 5 directories From 9cc8e87acf626eff503269593c1989418d555e20 Mon Sep 17 00:00:00 2001 From: liyapaul24 Date: Wed, 21 Aug 2024 20:18:28 -0400 Subject: [PATCH 2/5] save command changes --- 02_activities/assignments/assignment.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index e749bf07..77406bf6 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -11,6 +11,7 @@ set -x mkdir dir1 dir2 dir3 dir4 dir5 # 2. List the contents of the parent directory to verify the presence of the 5 directories +ls # 3. Create 5 text files in dir2 named file1, file2, file3, file4, and file5 From c1c6e12c163c2e344af01f8d11c040642d9c4254 Mon Sep 17 00:00:00 2001 From: liyapaul24 Date: Fri, 23 Aug 2024 23:22:28 -0400 Subject: [PATCH 3/5] Answered all assignment questions. --- 02_activities/assignments/assignment.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 77406bf6..ad1c8f74 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -14,13 +14,19 @@ mkdir dir1 dir2 dir3 dir4 dir5 ls # 3. Create 5 text files in dir2 named file1, file2, file3, file4, and file5 +touch dir2/file1 dir2/file2 dir2/file3 dir2/file4 dir2/file5 # 4. Append the words "Hello world" to dir2/file3 +echo "Hello world" >> dir2/file3 # 5. Verify that file3 contains the words "hello world" by printing the contents of the file in the terminal +cat dir2/file3 # 6. Delete file4 +rm dir2/file4 # 7. Delete directories dir4 and dir5 including all their contents (if any) +rm -r dir4 dir5 # 8. List the contents of the parent directory to verify the deletion of dir4 and dir5 +ls \ No newline at end of file From 463ced88e33efad8631028299e9f97748fb72cad Mon Sep 17 00:00:00 2001 From: liyapaul24 Date: Fri, 23 Aug 2024 23:34:42 -0400 Subject: [PATCH 4/5] modified answers in assignment.sh modified 3, 4, 5 answers --- 02_activities/assignments/assignment.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index ad1c8f74..72fc741e 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -14,13 +14,13 @@ mkdir dir1 dir2 dir3 dir4 dir5 ls # 3. Create 5 text files in dir2 named file1, file2, file3, file4, and file5 -touch dir2/file1 dir2/file2 dir2/file3 dir2/file4 dir2/file5 +touch dir2/file1.txt dir2/file2.txt dir2/file3.txt dir2/file4.txt dir2/file5.txt # 4. Append the words "Hello world" to dir2/file3 -echo "Hello world" >> dir2/file3 +echo "Hello world" >> dir2/file3.txt # 5. Verify that file3 contains the words "hello world" by printing the contents of the file in the terminal -cat dir2/file3 +cat dir2/file3.txt # 6. Delete file4 rm dir2/file4 @@ -29,4 +29,4 @@ rm dir2/file4 rm -r dir4 dir5 # 8. List the contents of the parent directory to verify the deletion of dir4 and dir5 -ls \ No newline at end of file +ls From 7934d2201935408301823095eb9838a9c4a9749e Mon Sep 17 00:00:00 2001 From: liyapaul24 Date: Fri, 23 Aug 2024 23:43:58 -0400 Subject: [PATCH 5/5] Modified answers for the second time --- 02_activities/assignments/assignment.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index ad1c8f74..97d21e9d 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -14,16 +14,16 @@ mkdir dir1 dir2 dir3 dir4 dir5 ls # 3. Create 5 text files in dir2 named file1, file2, file3, file4, and file5 -touch dir2/file1 dir2/file2 dir2/file3 dir2/file4 dir2/file5 +touch dir2/file1.txt dir2/file2.txt dir2/file3.txt dir2/file4.txt dir2/file5.txt # 4. Append the words "Hello world" to dir2/file3 -echo "Hello world" >> dir2/file3 +echo "Hello world" >> dir2/file3.txt # 5. Verify that file3 contains the words "hello world" by printing the contents of the file in the terminal -cat dir2/file3 +cat dir2/file3.txt # 6. Delete file4 -rm dir2/file4 +rm dir2/file4.txt # 7. Delete directories dir4 and dir5 including all their contents (if any) rm -r dir4 dir5