# Add multiple users (pratik, uday) to a group Devteam using a single command. (Verify using cat /etc/group)

## **Add Multiple Users (**`pratik`, `uday`) to the `Devteam` Group and Verify

This task involves:  
✅ Adding **multiple users (**`pratik` and `uday`) to the `Devteam` group in a **single command**.  
✅ Verifying the change using `/etc/group`.

---

## **🔹 Step 1: Add** `pratik` and `uday` to `Devteam` in One Command

### **Command:**

```plaintext
gpasswd -M pratik uday Devteam
             or
sudo usermod -aG Devteam pratik uday

```

### **Explanation:**

* `sudo` → Runs the command with **admin privileges**.
    
* `usermod` → Modifies user properties.
    
* `-aG Devteam` →
    
    * `-a` (append) → Ensures existing group memberships are **not removed**.
        
    * `-G Devteam` → Adds users to the `Devteam` **secondary group**.
        
* `pratik uday` → Users to be added.
    

---

## **🔹 Step 2: Verify the Change in** `/etc/group`

### **Command:**

```plaintext
cat /etc/group
 /etc/group | grep Devteam
```

### **Example Output (After Addition):**

```plaintext
Devteam:x:1005:pratik,uday
```

### **Explanation:**

* `Devteam` → The group name.
    
* `x` → Password field (managed by the system).
    
* `1005` → Group ID (GID).
    
* `pratik,uday` → Users are now part of the `Devteam` group.
    

---

## **🔹 Step 3: Confirm Each User’s Group Membership (Optio**groups pratik

**Expected Output:**pratik : pratik Devteam

### **Check for** `uday`:

```plaintext
groups uday
```

**Expected Output:**

```plaintext
uday : uday Devteam
```

---

## **🎯 Summary of Commands**

| Step | Command | Purpose |
| --- | --- | --- |
| **1** | `sudo usermod -aG Devteam pratik uday` | Add both users to `Devteam` in a single command |
| **2** | \`cat /etc/group | grep Devteam\` |
| **3** | `groups pratik` | Confirm `pratik`'s group membership |
| **4** | `groups uday` | Confirm `uday`'s group membership |

✅ **You have successfully added** `pratik` and `uday` to `Devteam`! 🎯
