ODFFILESEARCH(1p)

πŸ“¦
version 2.125 Β· 3 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu questing

πŸ’– ODFFILESEARCH πŸ’–

okay bestie, so this is odffilesearch, and it lives in the User Contributed Perl Documentation section of the manual. It's a whole vibe: file selection by keywords, no cap. πŸŽ€


✨ NAME ✨

odffilesearch β€” picking files by keywords, literally the easiest way πŸ¦‹


🌸 SYNOPSIS 🌸

odffilesearch -R "D:\Documents\*.odt" openoffice desktop XML

this one gives you the list of ODF Text documents hanging out in that directory and all its subdirectories, and containing the words "openoffice", "desktop" AND "XML" β€” yes, all three, it's giving thorough πŸ’…

odffilesearch -command "rm -f %f" "*.ods *.odt" lost dismiss cancel

and this one runs "rm -f filename" (aka deletes the file if you're on a Unix system, bestie that's a whole commitment 😭) for every ODT or ODS file sitting in the current directory that contains the words "lost", "dismiss" AND "cancel".


🌈 USAGE 🌈

odffilesearch [-options] <file filter> <keyword list>

πŸ’« DESCRIPTION πŸ’«

so what does this little icon do? it lets you pull back a list of files that match a set of keywords or regular expressions you hand it. A file gets selected when it contains β€” either in its text and/or in its metadata (that's title, subject, keywords or description) β€” all of the search strings you gave it. All of them. Every single one. πŸ‘‘

the selected files get echoed to standard output, one file per line, which means you can use this thing as a filter and pipe its results straight into another program. Obsessed. ✨ OR, if you'd rather, you can have it launch a given shell command every single time a file matches, which lets you process those selected documents on the fly, main character energy fr fr.

the file filter can hold one or more space-separated paths, and each path can contain jokers β€” so yeah, you can explore several directories and/or several filename patterns at once. Versatile queen. 🌸

and every argument after the file filter? processed as search criteria. Periodt.


πŸŽ€ OPTIONS πŸŽ€

  • -R, -recursive β€” pulls in the subdirectories of each search directory you gave it. Going deep, no cap. πŸ•³οΈ
  • -verbose, -trace, -debug β€” echoes some processing comments so you can see what's going on in there πŸ‘€
  • -warnings β€” activates the warning messages of the OpenOffice::OODoc API. Let it speak. πŸ—£οΈ
  • -log <file> β€” same energy as -verbose, except the messages get sent to the given file instead and don't pollute your standard output. So considerate πŸ’…
  • -result <file>, -output <file> β€” sends the list of matching files to the given file instead of to standard output πŸ“„
  • -criteria <file> β€” grabs search criteria from a file, one per line. The loaded search keywords can be combined with additional criteria passed on the command line, if there are any. Stack 'em. πŸ₯ž
  • -command <command>, -exec <command> β€” executes a shell command for each matching file. If the command string contains "%f", that substring gets replaced with the name of the selected file. If you use this option, the selection list is not echoed to standard output. And if -verbose is on, the value returned by the command gets echoed too. ⚑
  • -encoding <encoding> β€” selects your character set. This one is mandatory if one or more of your search criteria contain characters that don't belong to the default character set. Don't skip it, bestie, it will not go well πŸ”₯

heads up: that -command example up in the synopsis is running rm -f, which deletes files. Permanently. Be so sure before you run it, okay? πŸ’€πŸ«Ά

okay that's the whole page, you ate that πŸ’– this lil gem is from the perl v5.34.0 era, dated 2022-06-16, and it's filed under User Contributed Perl Documentation. go forth and search some files, bestie βœ¨πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from