Linux, terminal and Git

Stage 3 · Lesson 3 of 8

Finding files with find

Text tools

The walks through a folder and everything inside it, and matches files by name, type, size or age. find . -name "*.log" finds . find . -type d -name node_modules finds folders with that name.

find . -size +100M finds files over 100 MB, and find . -mtime -1 finds files changed in the last day. It can also act on what it finds, with -delete or -exec, which is powerful and dangerous. Always run the search on its own first and read the list before adding an action. searches inside files; find searches for the files themselves, and the two often work together.

Common trapputting -delete in the wrong place in the expression and removing everything find visits.

A question to check yourself, an AI practice session and 1 cheat sheet entry come when you add the roadmap to your account. Add it

Resources for this stage

Start with· follow one of these

Practise

  • Test regular expressions on sample text with a plain explanation of each part

  • Middle levels need grep, sort, uniq and find to locate the next password

Keep handy

  • The official jq manual with examples for every filter

  • Quick examples for find, sed, awk and friends when you forget the syntax

Mark this stage as not done?