# File Content

This assertion type helps you to verify if a certain text can be found inside the content of a file.

This is based on a "string contains" check.

## Expecting

Use this type to verify that the expected content does exist in the file.

```yaml
file_content:
    - name: "Verify webservice entry in /etc/hosts"
      file: "/etc/hosts"
      expected: "my-webservice x.x.x.x"
```

## Not Expecting

Use this type to ensure that the content does not exist in the file.

```yaml
file_content:
    - name: "Verify webservice entry not in /etc/hosts"
      file: "/etc/hosts"
      not_expected: "my-webservice x.x.x.x"
```


---

# 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://docs.svrunit.com/assertions/file-content.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.
