> For the complete documentation index, see [llms.txt](https://sh.howtocode.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sh.howtocode.dev/1.0.0.part1intro/1.2.0.manipulation/1.2.3.copy.md).

# ফাইল ও ডিরেক্টরি কপি করা

আমরা এর পূর্ববর্তী কয়েকটি উদাহরনে **cp** কমান্ডটি দেখেছি। ফাইল ও ডিরেক্টরি কপি করতে এই কমান্ডটি ব্যবহার করা হয়। এটা ব্যবহারের দুটো উপায়। প্রথমটি:

```
cp source_item destination_item
```

এখানে **source\_item** ও **destination\_item** উভয়েই ফাইল বা ডিরেক্টরি যেকোনোকিছু হতে পারে। কোনক্ষেত্রে ফলাফল কি হবে দেখে নিই:

|                           | সোর্স: ফাইল                                                                                               | সোর্স: ডিরেক্টরি                                             |
| ------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------ |
| **ডেস্টিনেশন: ফাইল**      | সোর্স ফাইলটি ডেস্টিনেশন ফাইলের জায়গায় কপি হবে। অর্থাৎ ওভাররাইড করবে। তবে ডেস্টিনেশন ফাইলের নাম ঠিক থাকবে। | এরর দেখাবে। কারন, ফাইলকে ডিরেক্টরি দিয়ে ওভাররাইড করা যায় না। |
| **ডেস্টিনেশন: ডিরেক্টরি** | সোর্স ফাইলটি ডেস্টিনেশন ডিরেক্টরির মধ্যে কপি হবে।                                                         | সোর্স ডিরেক্টরিটি ডেস্টিনেশন ডিরেক্টরির মধ্যে কপি হবে।       |

কপি কমান্ডের দ্বিতীয় কাঠামোটি হল:

```
cp source_item... destination_directory
```

অর্থাৎ আপনি একাধিক সোর্স ফাইল এবং ডিরেক্টরি একটি ডেস্টিনেশন ডিরেক্টরিতে কপি করতে পারবেন। মনে রাখবেন শেষ আর্গুমেন্ট টি ডিরেক্টরি হবে এবং ওইটিই ডেস্টিনেশন হবে সবসময়।

এবার আমরা **cp** কমান্ডের কিছু গুরুত্বপূর্ণ অপশনে নজর বুলিয়ে নিই:

| অপশন | লং অপশন       | অর্থ                                                                                                                                                                           |
| ---- | ------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| -a   | -- archive    | ফাইল বা ডিরেক্টরি তার সকল গুনাগুন যেমন ফাইল পার্মিশন এবং ওনারশিপ সম্পর্কিত তথ্যাবলী সহ কপি হবে।                                                                                |
| -i   | --interactive | সোর্স ও ডেস্টিনেশনে উভয় স্থানে একই ফাইল থাকে তাহলে ওভাররাইড করা হয়। এই অপশন যুক্ত করলে ওভাররাইড করার আগে জানতে চাইবে ওভাররাইড করা হবে কিনা।                                    |
| -r   | --recursive   | এই অপশন(বা -a) যুক্ত করলে ডিরেক্টরি তার সকল কন্টেন্ট সহ কপি করে। নতুবা ডিরেক্টরি কপি হয়না। অর্থাৎ ডিরেক্টরি কপি করতে গেলে এই অপশনটি অবশ্যই দিতে হবে(যদি -a ব্যবহার করা না হয়।) |
| -u   | --update      | সোর্স থেকে শুধু সেই ফাইলগুলোই কপি করা হবে যেগুলো ডেস্টিনেশনে নেই বা পুরাতন সময়ের আছে ।                                                                                         |
| -v   | --verbose     | সাধারনত, কপি করার সময় এরর না হলে কোনো তথ্যই দেখায় না। এই অপশন যোগ করলে কপি করার সম্পর্কিত তথ্যগুলি দেখাবে।                                                                     |

ব্যবহারিক জীবনে আমি সাধারণত সবসময় **cp -rv** ব্যবহার করি।


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.2.0.manipulation/1.2.3.copy.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.
