# What I Learned – Week 2 | Web2 Beginners (Cohort 3) This week focused on Linux system administration basics: managing users, groups, and permissions through the terminal. Group & User Management I Created a new group: ``` sudo groupadd Cohort-3-web2 Added users Ali and Bobb to the group: ``` ``` sudo useradd -G Cohort-3-web2 Ali sudo useradd -G Cohort-3-web2 Bobb sudo passwd Ali sudo passwd Bobb Verified group members: ``` ``` getent group Cohort-3-web2 Shared Directory Access Created a shared directory and assigned it to the group: ``` Confirmed that Ali and Bobb could create files in the directory using sudo -u. ``` mkdir ~/Documents/web2/cohort3 sudo chown :Cohort-3-web2 ~/Documents/web2/cohort3 ``` I learned that even within the same group, users can't edit each other's files without proper permissions. Additional Practice Created another group Cohort-2 and added a user Ola. Confirmed that Ola had no access to the cohort3 directory — reinforcing my understanding of group-based access control. ## Shell Scripting I also learnt "Bash script" and wrote a simple shell script that: Prompts the user to enter a valid directory and .sh filename Appends echo "welcome to shell scripting" to the created file This improved my use of read, loops, conditions, and file output in Bash. ## Key Takeaways - [ ] Use sudo when modifying system users or groups. - [ ] getent group is a useful command to verify group membership. - [ ] File access depends on both group ownership and file-level permissions. - [ ] Practical shell experience reinforces theoretical learning.