Skip to content

Commit 73dd5a1

Browse files
committed
completed assignment
1 parent 4b2cd69 commit 73dd5a1

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

02_activities/assignments/assignment.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,27 @@ unzip -q rawdata.zip
3131
mkdir data
3232

3333
# 2. Move the ./rawdata directory to ./data/raw
34+
mv rawdata data/raw
3435

3536
# 3. List the contents of the ./data/raw directory
37+
ls data/raw
3638

3739
# 4. In ./data/processed, create the following directories: server_logs, user_logs, and event_logs
40+
mkdir -p data/processed/server_logs data/processed/user_logs data/processed/event_logs
3841

3942
# 5. Copy all server log files (files with "server" in the name AND a .log extension) from ./data/raw to ./data/processed/server_logs
43+
find data/raw -name "*server*.log" -exec cp {} data/processed/server_logs \;
4044

4145
# 6. Repeat the above step for user logs and event logs
46+
find data/raw -name "*user*.log" -exec cp {} data/processed/user_logs \;
47+
find data/raw -name "*event*.log" -exec cp {} data/processed/event_logs \;
4248

4349
# 7. For user privacy, remove all files containing IP addresses (files with "ipaddr" in the filename) from ./data/raw and ./data/processed/user_logs
50+
find data/raw -name "*ipaddr*" -delete
51+
find data/processed/user_logs -name "*ipaddr*" -delete
4452

4553
# 8. Create a file named ./data/inventory.txt that lists all the files in the subfolders of ./data/processed
46-
54+
find data/processed -type f > data/inventory.txt
4755

4856
###########################################
4957

0 commit comments

Comments
 (0)