From e976b55a5c2a83f4f2ab1221ea228c9b8737db4f Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:32:09 -0500 Subject: [PATCH 1/7] delete ip logs... WARNING UNTESTED! --- 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 d81e9a77b..001291867 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -33,6 +33,7 @@ unzip rawdata.zip # 6. Repeat the above step for user logs and 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 +rf -rf ./data # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed From ea20676d33161a6f4d0fcd3c4f7aa5360f0f4309 Mon Sep 17 00:00:00 2001 From: Simeon Wong Date: Thu, 14 Nov 2024 20:55:44 -0500 Subject: [PATCH 2/7] initialize README file with company name --- 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 001291867..f2bfd22bd 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -11,6 +11,7 @@ set -x mkdir analysis output touch README.md +echo "# Project Name: DSI Consulting Inc." > README.md touch analysis/main.py # download client data From c567a1916aec389921acb0dfc04d5a86b7e18669 Mon Sep 17 00:00:00 2001 From: Bickolus Date: Mon, 20 Oct 2025 00:43:01 -0400 Subject: [PATCH 3/7] added shell commands to finish the assignment --- 02_activities/assignments/assignment.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 8af8dc092..9796dcb06 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -28,20 +28,39 @@ unzip -q rawdata.zip # Complete assignment here # 1. Create a directory named data +mkdir data # 2. Move the ./rawdata directory to ./data/raw +cd data +mkdir raw +cd .. +mv rawdata data/raw # 3. List the contents of the ./data/raw directory +cd data +ls raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs +mkdir processed +cd processed +mkdir server_logs +mkdir user_logs +mkdir 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 +cd .. +cp raw/rawdata/*server*.log processed/server_logs # 6. Repeat the above step for user logs and event logs +cp raw/rawdata/*user*.log processed/user_logs +cp raw/rawdata/*event*.log 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 raw/rawdata/*ipaddr* +rm processed/user_logs/*ipaddr* # 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed +ls -R processed > inventory.txt ########################################### From 83782a86fff5e8e37cd6caba118d4eb7e680dc73 Mon Sep 17 00:00:00 2001 From: Bickolus Date: Mon, 20 Oct 2025 01:16:08 -0400 Subject: [PATCH 4/7] Added the newproject file and made an attempt to fix Q3's command --- 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 9796dcb06..3f5839eef 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -37,10 +37,10 @@ cd .. mv rawdata data/raw # 3. List the contents of the ./data/raw directory -cd data -ls raw +ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs +cd data mkdir processed cd processed mkdir server_logs From b3c797512be7776442c3804bf493633198fe7747 Mon Sep 17 00:00:00 2001 From: Bickolus Date: Tue, 21 Oct 2025 18:54:20 -0400 Subject: [PATCH 5/7] refactored code so it is easier for the grader to understand --- 02_activities/assignments/assignment.sh | 27 ++++++++++--------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 995506b50..ca0181dba 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -32,36 +32,31 @@ unzip -q rawdata.zip mkdir data # 2. Move the ./rawdata directory to ./data/raw -cd data -mkdir raw -cd .. +mkdir data/raw mv rawdata data/raw # 3. List the contents of the ./data/raw directory ls data/raw # 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs -cd data -mkdir processed -cd processed -mkdir server_logs -mkdir user_logs -mkdir event_logs +mkdir data/processed +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 -cd .. -cp raw/rawdata/*server*.log processed/server_logs +cp data/raw/rawdata/*server*.log data/processed/server_logs # 6. Repeat the above step for user logs and event logs -cp raw/rawdata/*user*.log processed/user_logs -cp raw/rawdata/*event*.log processed/event_logs +cp data/raw/rawdata/*user*.log data/processed/user_logs +cp data/raw/rawdata/*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 raw/rawdata/*ipaddr* -rm processed/user_logs/*ipaddr* +rm data/raw/rawdata/*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 -R processed > inventory.txt +ls -R data/processed > data/inventory.txt ########################################### From bf166fe6e92b8f00abfbda0a365b56b9ff90d0b9 Mon Sep 17 00:00:00 2001 From: Bickolus Date: Tue, 21 Oct 2025 20:12:11 -0400 Subject: [PATCH 6/7] changing cp to mv --- 02_activities/assignments/assignment.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index ca0181dba..29c3304dd 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -45,11 +45,11 @@ 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/rawdata/*server*.log data/processed/server_logs +mv data/raw/rawdata/*server*.log data/processed/server_logs # 6. Repeat the above step for user logs and event logs -cp data/raw/rawdata/*user*.log data/processed/user_logs -cp data/raw/rawdata/*event*.log data/processed/event_logs +mv data/raw/rawdata/*user*.log data/processed/user_logs +mv data/raw/rawdata/*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/rawdata/*ipaddr* From 45bdf86ffcd335aee33a8ccac9fcc65ca2b2bd3e Mon Sep 17 00:00:00 2001 From: Bickolus Date: Tue, 21 Oct 2025 20:19:50 -0400 Subject: [PATCH 7/7] changing mv back to cp, remove all mentions of /rawdata directory --- 02_activities/assignments/assignment.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/02_activities/assignments/assignment.sh b/02_activities/assignments/assignment.sh index 29c3304dd..f189a0d32 100644 --- a/02_activities/assignments/assignment.sh +++ b/02_activities/assignments/assignment.sh @@ -32,7 +32,6 @@ unzip -q rawdata.zip mkdir data # 2. Move the ./rawdata directory to ./data/raw -mkdir data/raw mv rawdata data/raw # 3. List the contents of the ./data/raw directory @@ -45,14 +44,14 @@ 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 -mv data/raw/rawdata/*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 -mv data/raw/rawdata/*user*.log data/processed/user_logs -mv data/raw/rawdata/*event*.log data/processed/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/rawdata/*ipaddr* +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