FIND2PERL(1)
π FIND2PERL β the manual page, but make it cute π
okay bestie, gather round, because we're talking about find2perl from the User Contributed Perl Documentation section (that's section 1, the user commands one, iykyk) π
β¨ NAME β¨
find2perl β the girl who translates your find command lines into straight-up Perl code π₯
π SYNOPSIS π
find2perl [paths] [predicates] | perl
π¦ DESCRIPTION π¦
so find2perl is literally just a tiny little translator, no cap π It takes find command lines and turns them into equivalent Perl code. And the tea? The code it spits out is typically faster than running find itself. periodt. πβοΈπ¨
paths are a set of paths where find2perl will start its searches, and predicates are taken from the following list π
! PREDICATEβ negates the vibe of the predicate that comes next. The!must be passed as a distinct argument, so you may need to surround it with whitespace and/or quote it from interpretation by the shell using a backslash (just as with usingfind(1)). π( PREDICATES )β groups the givenPREDICATEStogether, like a little friendship circle π«Ά The parentheses must be passed as distinct arguments, so they may need to be surrounded by whitespace and/or quoted from interpretation by the shell using a backslash (just as with usingfind(1)).PREDICATE1 PREDICATE2β true if bothPREDICATE1andPREDICATE2are true;PREDICATE2is not evaluated ifPREDICATE1is false. it's giving "if you can't come through on the first one, don't even bother with the second" πPREDICATE1 -o PREDICATE2β true if either one ofPREDICATE1orPREDICATE2is true;PREDICATE2is not evaluated ifPREDICATE1is true. main character gets there first, second one doesn't even get screen time π-followβ follow (dereference) symlinks. π§ The checking of file attributes depends on the position of the-followoption. If it precedes the file check option, anstatis done, which means the file check applies to the file the symbolic link is pointing to. If-followfollows the file check option, this now applies to the symbolic link itself, i.e. anlstatis done. order matters bestie, don't play with it β οΈ-depthβ change directory traversal algorithm from breadth-first to depth-first. π going deep instead of going wide, we love a vibe shift-pruneβ do not descend into the directory currently matched. it said "not today", and it meant it β-xdevβ do not traverse mount points (prunes search at mount-point directories). staying in your own lane fr fr π§-nameGLOB β file name matches the specifiedGLOBwildcard pattern.GLOBmay need to be quoted to avoid interpretation by the shell (just as with usingfind(1)). πΈ-inameGLOB β like-name, but the match is case insensitive. lowercase, uppercase, idc, we're matching either way π-pathGLOB β path name matches the specifiedGLOBwildcard pattern. π€οΈ-ipathGLOB β like-path, but the match is case insensitive. π¦-permPERM β low-order 9 bits of permission match octal valuePERM. π-perm -PERMβ the bits specified inPERMare all set in the file's permissions. every single one, no exceptions, we're thorough π-typeX β the file's type matches perl's-Xoperator. π―-fstypeTYPE β filesystem of current path is of typeTYPE(only NFS/non-NFS distinction is implemented). that's the whole menu, bestie, just those two π-userUSER β true ifUSERis the owner of the file. π€-groupGROUP β true if the file's group isGROUP. π₯-nouserβ true if the file's owner is not in the password database. ghost owner energy π»-nogroupβ true if the file's group is not in the group database. π»-inumINUM β true if the file's inode number isINUM. π’-linksN β true if the (hard) link count of the file matchesN(see below). π-sizeN β true if the file's size matchesN(see below).Nis normally counted in 512-byte blocks, but a suffix ofcspecifies that size should be counted in characters (bytes) and a suffix ofkspecifies that size should be counted in 1024-byte blocks. π-atimeN β true if the last-access time of the file matchesN(measured in days) (see below). β°-ctimeN β true if the last-changed time of the file's inode matchesN(measured in days, see below). π°οΈ-mtimeN β true if the last-modified time of the file matchesN(measured in days, see below). π-newerFILE β true if the last-modified time of the file matchesN. π-printβ print out the path of the file (always true). π¬ If none of-exec,-ls,-print0, or-okis specified, then-printwill be added implicitly. it's the default bestie, it just shows up π«Ά-print0β like-print, but terminates with\0instead of\n. null-terminated, because newlines in filenames are a menace π-execOPTIONS;βexec()the arguments inOPTIONSin a subprocess; any occurrence of{}inOPTIONSwill first be substituted with the path of the current file. Note that the commandrmhas been special-cased to use perl'sunlink()function instead (as an optimization). The;must be passed as a distinct argument, so it may need to be surrounded by whitespace and/or quoted from interpretation by the shell using a backslash (just as with usingfind(1)). πβοΈ-okOPTIONS;β like-exec, but first prompts the user; if the user's response does not begin with ay, skip the exec. consent first, always π«Ά The;must be passed as a distinct argument, so it may need to be surrounded by whitespace and/or quoted from interpretation by the shell using a backslash (just as with usingfind(1)).-evalEXPR β has the perl scripteval()theEXPR. πͺ-lsβ simulates-exec ls -dils {} ;. π-tarFILE β adds current output to tar-formatFILE. π¦-cpioFILE β adds current output to old-style cpio-formatFILE. ποΈ-ncpioFILE β adds current output to "new"-style cpio-formatFILE. ποΈ
π’ the N forms, because numbers have three moods π’
Predicates which take a numeric argument N can come in three forms:
Nis prefixed with a+: match values greater thanNπNis prefixed with a-: match values less thanNπNis not prefixed with either+or-: match only values equal toNπ―
π SEE ALSO π
find, File::Find. go read those too, they're iconic π
and that's the whole page bestie!! this was documented for perl v5.42.0, dated 2025-07-25, and honestly? slay. π β¨ stay hydrated, quote your globs, and never let the shell eat your semicolons ππ¦
π¦ where this page comes from
- fedora 43: perl-App-find2perl 1.005-26.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms