# First Grep

<figure><img src="https://1100854798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F94YmDHMJbD21F4uOcvHm%2Fuploads%2FWNsj16TH12cdnJOSLKLm%2Fimage.png?alt=media&#x26;token=5a1ea5a1-9b54-4edc-b386-2491f86c9216" alt=""><figcaption></figcaption></figure>

Download it:

{% code overflow="wrap" %}
```bash
curl -s https://jupiter.challenges.picoctf.org/static/515f19f3612bfd97cd3f0c0ba32bd864/file -o file
```
{% endcode %}

<figure><img src="https://1100854798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F94YmDHMJbD21F4uOcvHm%2Fuploads%2FNn6fLgTFRohj5zsV2f2x%2Fimage.png?alt=media&#x26;token=16b33fa6-5dc0-4371-98e9-68f0a31d2776" alt=""><figcaption></figcaption></figure>

We can try to read that file with cat:

```bash
cat file
```

<figure><img src="https://1100854798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F94YmDHMJbD21F4uOcvHm%2Fuploads%2FlVK5i05QXPDcSEZYaeKu%2Fimage.png?alt=media&#x26;token=b7a253e6-0e07-4fb6-9990-dc5602aee399" alt=""><figcaption></figcaption></figure>

Because the file is not very big we can see the flag directly, but also we can use grep which is a command line that helps us to get some string or regex from a file:

```bash
cat file | grep 'picoCTF{.*?}'
```

<figure><img src="https://1100854798-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F94YmDHMJbD21F4uOcvHm%2Fuploads%2F7tFXs7rSbnlnayfFc94s%2Fimage.png?alt=media&#x26;token=21b6e796-8655-4c50-b1ad-25b9cf398796" alt=""><figcaption></figcaption></figure>

We solved it.
