From c22952aceb1c73f6cdad90a65b09aab56b83a4ad Mon Sep 17 00:00:00 2001 From: Liza Igoshina Date: Wed, 4 Mar 2026 19:25:16 -0500 Subject: [PATCH 1/2] Completed shell module assignment 1 --- 02_activities/assignments/assignment.sh | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 4b48cec8b..6077d218e 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -1,4 +1,4 @@ -#!/bin/bash +d#!/bin/bash set -x ############################################ @@ -28,22 +28,26 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data - +mkdir data # 2. Move the ./rawdata directory to ./data/raw (eg. move it into ./data and rename it to raw) - +mv ./rawdata ./data/raw # 3. List the contents of the ./data/raw directory - +ls ./data/raw # 4. Create the directory ./data/processed, +mkdir ./data/processed # then create the following sub-directories within it: server_logs, user_logs, and event_logs - +mkdir ./data/processed/server_logs .data/processed/user_logs ./data/processed/event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs - +cp ./data/raw/*server*.log ./data/processed/server_logs/ # 6. Repeat the above step for user logs and event logs - +cp ./data/raw/*user*.log ./data/processed/user_logs/ +cp ./data/raw/*event*.log ./data/processed/event_logs/ # 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs - +rm ./data/raw/*ipaddr* +rm ./data/processed/*/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed - +ls ./data/processed/* > ./data/inventory.txt +cat ./data/inventory.txt ########################################### From d5393e4385b283d650079478ea37e598f7e4fbb3 Mon Sep 17 00:00:00 2001 From: eigoshie <72001346+eigoshie@users.noreply.github.com> Date: Wed, 4 Mar 2026 19:53:56 -0500 Subject: [PATCH 2/2] added the two missing directories need to add each directory with mkdir, cannot stack in a line --- 02_activities/assignments/assignment.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 6077d218e..3d50c7e73 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -36,7 +36,9 @@ ls ./data/raw # 4. Create the directory ./data/processed, mkdir ./data/processed # then create the following sub-directories within it: server_logs, user_logs, and event_logs -mkdir ./data/processed/server_logs .data/processed/user_logs ./data/processed/event_logs +mkdir ./data/processed/server_logs +mkdir .data/processed/user_logs +mkdir ./data/processed/event_logs # 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs cp ./data/raw/*server*.log ./data/processed/server_logs/ # 6. Repeat the above step for user logs and event logs