# Searching for files

By default, queries search both filenames and file contents. You can limit your
search to just filenames in several ways. For example, you can use the
[`file`](https://developers.google.com/code-search/reference#filters) filter to search for a file by using its path.
For example:

    file:main

The following filters return the same results as the `file` filter:

- `filepath`
- `f`
- `path`

You can also search for a file name by typing its name and extension. For
example:

    f:main\.java

> [!NOTE]
> **Note:** The preceding example escapes the period (`\.`). This is so the search doesn't match filenames without periods like mainjava.