# ওনার ইউজার ও গ্রুপ পরিবর্তন

কোনো ফাইল বা ডিরেক্টরির মালিকানা পরিবর্তনের দুটো কমান্ড আছে। **chown** ও **chgrp**। অবশ্য **chown** একাই ওনার ইউজার ও গ্রুপ পরিবর্তনে সক্ষম। **chgrp** শুধু ওনার গ্রুপ পরিবর্তন করতে পারে। তবুও কখনো কখনো **chgrp** ব্যবহার করা হয় সরল কাঠামোর জন্য। প্রথমে দেখা যাক **chgrp** এর ব্যবহার:

```
me@howtocode-pc:~$ > foo.txt
me@howtocode-pc:~$ ls -l foo.txt 
-rw-rw-r-- 1 me me 0 Oct  7 22:51 foo.txt
me@howtocode-pc:~$ chgrp video foo.txt 
me@howtocode-pc:~$ ls -l foo.txt 
-rw-rw-r-- 1 me video 0 Oct  7 22:51 foo.txt
```

প্রথমে আমরা foo.txt নামের একটি ফাইল তৈরী করেছি। তারপর `ls -l foo.txt` কমান্ড দিয়ে দেখলাম এটির মালিক ইউজার me এবং মালিক গ্রুপও me নামের একটি গ্রুপ। এখন আমরা video নামের একটি গ্রুপকে মালিকানা দিতে চাই। তাই `chgrp video foo.txt` কমান্ডটি দিয়েছি। অর্থাৎ chgrp এর কমান্ড কাঠামোটি হল:

```
chgrp group_name file_or_directory...
```

এরপর আমরা আবার `ls -l foo.txt` কমান্ড দিয়ে দেখলাম যে গ্রুপ পরিবর্তিত হয়ে video হয়ে গেছে।

**chown** কমান্ডটি ব্যবহার করতে সুপারইউজার বা রুট পারমিশন প্রয়োজন হয়। এর কমান্ড কাঠামোটি এরকম:

```
chown owner:group file_or_directory...
```

এই **owner:group** এর জায়গায় শুধু ওনার এর নাম বা ':' চিহ্নের পর শুধু গ্রুপের নাম বা মাঝখানে ':' চিহ্ন রেখে ইউজার ও গ্রুপ দুটোর নামই দেয়া যায়। আসুন এর আর্গুমেন্টের কয়েকটা উদাহরণ দেখা যাক:

| আর্গুমেন্ট | রেজাল্ট                                                                                             |
| ---------- | --------------------------------------------------------------------------------------------------- |
| bob        | ফাইলটির ওনার ইউজার হবে bob নামের ইউজার। ওনার গ্রুপ অপরিবর্তিত থাকবে।                                |
| bob:users  | ফাইলটির ওনার ইউজার হবে bob এবং ওনার গ্রুপ হবে users নামের গ্রুপ।                                    |
| :admins    | ফাইলটির ওনার ইউজার অপরিবর্তিত থাকবে কিন্তু ওনার গ্রুপ হবে admins।                                   |
| bob:       | ফাইলটির ওনার ইউজার হবে bob এবং গ্রুপ হবে bob এর লগিন গ্রুপ, যেটি কিনা সাধারনত তার নামের গ্রুপটি হয়। |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sh.howtocode.dev/1.0.0.part1intro/1.6.0.permission/1.6.6.chowngrp.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
