# অনুশীলন

আমরা এযাবৎ `find` কমান্ডের যেসব ব্যবহার দেখলাম, আসুন একবার ঝালিয়ে নেওয়া যাক।

প্রথমেই আমরা হোম ডিরেক্টরিতে playground নামে একটি ফোল্ডার করবো। যারমধ্যে dir-001 থেকে শুরু করে dir-100 পর্যন্ত মোট ১০০ টি ফোল্ডার থাকবে এবং প্রতিটি ফোল্ডারে file-A থেকে file-Z পর্যন্ত ৩৬ করে ফাইল থাকবে:

```
me@howtocode-pc:~$ mkdir -p playground/dir-{001..100}
me@howtocode-pc:~$ touch playground/dir-{001..100}/file-{A..Z}
```

এখন আমরা সেইসব ফাইল বের করবো খুৃঁজে যেগুলোর নাম 'file-A':

```
me@howtocode-pc:~$: find playground -type f -name 'file-A'
```

আমরা একটি দীর্ঘ লিস্ট দেখতে পাবো। মোট ফাইলের সংখ্যা জেনে নেবো এভাবে:

```
me@howtocode-pc:~$ find playground -type f -name 'file-A' | wc -l
100
```

এবার আমরা মোডিফিকেশনের সময় অনুযায়ী ফাইল খুঁজবো। এর জন্য আমাদের একটি ফাইল লাগবে যার সাথে আমরা তুলনা করতে পারি। সেটি তৈরী করবো এভাবে:

```
me@howtocode-pc:~$ touch playground/timestamp
me@howtocode-pc:~$ stat playground/timestamp
  File: ‘playground/timestamp’
  Size: 0        Blocks: 0          IO Block: 4096   regular empty file
Device: 802h/2050d    Inode: 8306121     Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1000/nishadsingha)   Gid: ( 1000/nishadsingha)
Access: 2015-04-03 15:39:54.671495249 +0600
Modify: 2015-04-03 15:39:54.671495249 +0600
Change: 2015-04-03 15:39:54.671495249 +0600
 Birth: -
```

আমরা `touch playground/timestamp` কমান্ড দিয়ে আমাদের রেফারেন্স ফাইলটি তৈরী করেছি। এবং `stat playground/timestamp` কমান্ড দিয়ে তার সম্পর্কে তথ্যগুলো দেখলাম। আমরা মোডিফিকেশনের সময় দেখতে পাচ্ছি। এবার আমরা কিছু ফাইলকে `touch` কমান্ডের মাধ্যমে নতুন মোডিফিকেশনের সময় দোবো:

```
me@howtocode-pc:~$ find playground -type f -name 'file-B' -exec touch '{}' ';'
```

আমরা file-B নামের সকল ফাইলকে আপডেট করেছি। এবার সেইসব ফাইল খুঁজবো যেগুলো timestamp ফাইলটির থেকে মোডিফিকেশনের সময় অনুযায়ী নতুন:

```
me@howtocode-pc:~$ find playground -type f -newer playground/timestamp
```

স্বাভাবিকভাবেই file-B নামের সকল ফাইলই এই লিস্টে থাকবে।

এবার আমরা জটিল একটা কাজ করে শেষ করবো। আমরা দেখবো কোন ফাইলগুলোর পারমিশন **0600** না এবং কোন ডিরেক্টরিগুলোর **0700** না এবং তাদের ওই পারমিশন দেবো:

```
me@howtocode-pc:~$ find playground \( -type f -not -perm 0600 -exec chmod 0600 '{}' ';' \) -or \( -type d -not -perm 0700 -exec chmod 0700 '{}' ';' \)
```


---

# 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/3.0.0.part3intro/3.5.0.0.search/3.5.2.0.find/3.5.2.5.playground.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.
