find: Type, Size and Time
More ways to search.
Names are only one way to search. Find can also look for folders only, for big files that fill up your disk, or for files you changed recently.

- Not just names
- Folders, big files
- Recent changes
Only folders, or only files
Dash type D finds only directories. Dash type F finds only normal files. Here we list every folder inside projects. It's a quick way to see the shape of a project.
find projects -type d projects projects/website projects/website/css projects/scripts
Big files
Dash size, plus one M, means bigger than one megabyte. That's how you find what's filling up your disk. In our home, the only big file is a video in Downloads. Add dash LS at the end, to see its size and details too.
find . -size +1M ./Downloads/video.mp4 find . -size +1M -ls 880071 2444 -rw-r--r-- 1 sam sam 2500000 Jan 5 09:00 ./Downloads/video.mp4
Recent files, and doing things
Dash M time, minus one, finds files changed in the last day. Dash M min, minus thirty, means the last thirty minutes. Find can also do something to every file it finds, with dash exec, or delete them with dash delete. Always run find without dash delete first, to check the list.
| key | value |
|---|---|
| -mtime -1 | changed in the last day |
| -mmin -30 | the last 30 minutes |
| -exec cmd {} \; | run a command on each |
| -delete | careful: check first |
Summary
Find can search by type, by size, and by time, and can act on what it finds. Next, shortcuts to files, called links, and checking disk space.
Key takeaways- -type d / -type f
- -size +1M
- -mtime -1