From d6b417bc422be27eb22b2ab8c78b855b4f365622 Mon Sep 17 00:00:00 2001 From: Xuejian Xiong Date: Wed, 8 Apr 2026 19:13:45 -0400 Subject: [PATCH 1/2] finish the assignment.sh --- 02_activities/assignments/assignment.sh | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 4b48cec8b..38cd13d07 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -29,21 +29,45 @@ unzip -q rawdata.zip # 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 +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 +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/user_logs/*ipaddr* + # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +ls -l ./data/processed/* -> ./data/inventory.txt ########################################### From e1aadfd7778a92ec930a9f0e84d94040f6e7138e Mon Sep 17 00:00:00 2001 From: Xuejian Xiong Date: Wed, 8 Apr 2026 19:16:16 -0400 Subject: [PATCH 2/2] completed the assignment.sh --- 02_activities/assignments/assignment.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 38cd13d07..0adae3b92 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -51,7 +51,7 @@ 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 +cp ./data/raw/*server*.log ./data/processed/server_logs # 6. Repeat the above step for user logs and event logs @@ -67,7 +67,7 @@ rm ./data/processed/user_logs/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed -ls -l ./data/processed/* -> ./data/inventory.txt +ls -l ./data/processed/* > ./data/inventory.txt ###########################################