Skip to content

Commit 29dc484

Browse files
committed
modified: assignment.sh
1 parent 7a0d963 commit 29dc484

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

02_activities/assignments/assignment.sh

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,31 @@ unzip -q rawdata.zip
2626

2727
###########################################
2828
# Complete assignment here
29-
29+
echo "Sean's Assignment running"
3030
# 1. Create a directory named data
31+
mkdir data
3132

3233
# 2. Move the ./rawdata directory to ./data/raw
34+
mv ./rawdata data/raw
3335

3436
# 3. List the contents of the ./data/raw directory
37+
ls -l ./data/raw
3538

3639
# 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs
37-
40+
mkdir -p ./data/processed/server_logs
41+
mkdir -p ./data/processed/user_logs
42+
mkdir -p ./data/processed/event_logs
3843
# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs
39-
44+
cp ./data/raw/*server*.log ./data/processed/server_logs/
4045
# 6. Repeat the above step for user logs and event logs
41-
46+
cp ./data/raw/*user*.log ./data/processed/user_logs/
47+
cp ./data/raw/*event*.log ./data/processed/event_logs/
4248
# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs
4349

50+
rm ./data/raw/*ipaddr*
51+
rm ./data/processed/user_logs/*ipaddr*
4452
# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed
45-
53+
echo "Inventory file created at ./data/inventory.txt"
4654

4755
###########################################
4856

0 commit comments

Comments
 (0)