# Finding Things

Find text inside files and find files anywhere.

Updated: November 10, 2026

## [Finding Text](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-finding-text)

1. [Finding Text: grep](https://www.ask-codey.com/lessons/bash-grep) (Apprentice): grep prints every line that contains a word or phrase, in one file, in many files or in a whole folder, and its options ignore capitals, number the lines, list only the files that match, count the matches or show the lines that don't match.
2. [Patterns: Regular Expressions for grep](https://www.ask-codey.com/lessons/bash-regular-expressions) (Journeyman): A regular expression describes the shape of the text you want instead of the exact words, so grep can find every phone number or every date in a file; this lesson builds patterns from . and \[ \], ^ and $, \* and, with grep -E, + and |.

## [Finding Files](https://www.ask-codey.com/courses/bash-in-depth/topics/bash-finding-files)

1. [Finding Files: find](https://www.ask-codey.com/lessons/bash-find) (Apprentice): find searches a folder and every folder inside it for files by name, type, size or age, and with -exec it runs a command on each file it finds, best tried with echo first so you see what would happen.

## [Exercise: The Archive Detective](https://www.ask-codey.com/courses/bash-in-depth/topics/exercise-bash-the-archive-detective)

1. [Exercise: The Archive Detective](https://www.ask-codey.com/lessons/exercise-bash-the-archive-detective) (Apprentice): Solve a small mystery in the town archive by searching two weeks of door logs with grep and a regular expression, tracking down a locker, a hidden file and a big scan with find, and clearing out leftover files with find -exec, while a check script tells you which answers are right.

Source: https://www.ask-codey.com/courses/bash-in-depth/chapters/bash-finding-things
