# Performing Scans on Directories and Files

Here are the commands and explanations for initiating scans:

## **Basic Scan**

To perform a basic scan on a specified directory:

<pre class="language-bash"><code class="lang-bash">fourclover snapshot <a data-footnote-ref href="#user-content-fn-1">mytargetdir</a>
</code></pre>

This command initiates a scan on the specified directory and generates a scan report.

## **Specifying Output File**

To save the scan report to a specific file:

<pre class="language-bash"><code class="lang-bash">fourclover snapshot mytargetdir -out <a data-footnote-ref href="#user-content-fn-2">scan_report.json</a>
</code></pre>

Use the `-out` option followed by the desired file name.

## **Hash Algorithm Selection**

To select specific hash algorithms for file verification:

<pre class="language-bash"><code class="lang-bash">fourclover snapshot mytargetdir -hashes <a data-footnote-ref href="#user-content-fn-3">sha256,md5</a>
</code></pre>

Use the `-hashes` option followed by a comma-separated list of hash algorithm names.

## **Excluding Files/Directories**

To exclude specific files or directories from the scan:

<pre class="language-bash" data-full-width="false"><code class="lang-bash">fourclover snapshot mytargetdir -exclude <a data-footnote-ref href="#user-content-fn-4">.git,node_modules</a>
</code></pre>

Use the `-exclude` option followed by a comma-separated list of file/directory names.

## **Focusing on File Extensions**

To scan only files with specific extensions:

<pre class="language-bash"><code class="lang-bash">fourclover snapshot mytargetdir -focus <a data-footnote-ref href="#user-content-fn-5">.py,.js,.txt</a>
</code></pre>

Use the `-focus` option followed by a comma-separated list of file extensions.

## **Adding a Report Name**

To add a name to the scan report (useful for comparison purposes):

<pre class="language-bash"><code class="lang-bash">fourclover snapshot mytargetdir -name <a data-footnote-ref href="#user-content-fn-6">"My Project"</a>
</code></pre>

Use the `-name` option followed by the desired name.

[^1]: This is your target directory. Sub directory part is not supported.

[^2]: This can be your desired file name.

[^3]: A comma-separated list of hash algorithm names.

[^4]: A comma-separated list of file/directory names.

[^5]: A comma-separated list of file extensions.

[^6]: The desired name of the snapshot. You can use it to track the snapshot.


---

# 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.fourclover.org/v0.1/tool-guides/performing-scans-on-directories-and-files.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.
