FIND(1)

πŸ“¦ version 1.053, in alpine 3.24

🌸 FIND(1) β€” the perl one, bestie 🌸

okay so real talk: this is find(1) as shipped in the User Contributed Perl Documentation, not the C one you're thinking of. same name, same vibe, different little guy. πŸ’…


✨ NAME ✨

find β€” search a directory tree for files matching a pattern. that's it, that's the whole job, and she does it slayfully. πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

find [ -HdhXxW ] [ Directory ] [ expression ]

that's the whole shape of it. flags, a directory, an expression. chef's kiss. 🫢


πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, and it's kind of iconic: this find is actually a front end for find2perl. 😭 like, you type your lil search, and it automatically converts your request to perl and executes it. yes, really. and unless something goes wrong, you probably will not see a difference β€” it's giving "same energy, secret perl underneath." 🧚

but listen bestie, if you wanna do something fancier, or you're gonna be running the same search often, you should give the commands straight to find2perl and run the perl code yourself β€” after possible modification, obviously. that's the upgrade path. ⭐

so what does she actually do? find searches a directory tree for files matching given criteria, then executes user specified commands on those files. periodt. πŸ‘‘


🌈 Examples (the fun part) 🌈

Example one: find and print a list of all files on the system (disk) with a .pm extension (perl modules).

find / -name "*.pm" -print

Example two: find and delete all files in the current directory and subdirectories that end with .bak and have not been accessed in the last 10 days (using unix rm command to do the deleting).

find . -name "*.bak" -atime +10 -exec rm {};
⚠️ bestie, read that second one again. it deletes files. it's using rm. run it in the wrong place and that's a no-thoughts-head-empty moment you cannot undo. πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

  • find β€” yes, it really does just say find here. recursion is a mood. πŸ™ˆ
  • File/Find.pm

πŸ’œ RESTRICTIONS πŸ’œ

ngl, find2perl may not cover all the options that various versions of find implement. she's not claiming to be every find. it's only a wrapper to find2perl, so it has all the same restrictions β€” and some people have said that find2perl needs updating. πŸ‘€ not me saying it, the manpage saying it.


πŸ“ BUGS πŸ“

this manpage should probably include the entire find manpage, and perhaps that of find2perl as well. so like... yeah. it's a little under-documented and she knows it. 😭


πŸ‘‘ AUTHOR πŸ‘‘

  • This front-end written by Greg Snow, snow@biostat.washington.edu, with many things "borrowed" from the awk front-end by Tom Christiansen, tchrist@perl.com. 🫢
  • The find2perl translator was written by Larry Wall, larry@wall.org, author of Perl. literal main character energy. ✨

This program is copyright (c) Gregory L. Snow 1999 (with parts "borrowed" from things copyright (c) Tom Christiansen 1999).

This program is free and open software. You may use, modify, distribute, and sell this program (and any modified variants) in any way you wish, provided you do not restrict others from doing the same. πŸ’– that's the whole license, it's short and sweet and honestly kinda wholesome.


okay that's the page!! mwah πŸ’‹

sign-off szn: this gorgeous little doc ships with perl v5.42.2 and is dated 2026-02-15 β€” so if you're reading this from the future, hi, hope your directory tree is immaculate. πŸ¦‹βœ¨πŸŽ€

πŸ“¦ where this page comes from