Futilities/human/ff: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
No edit summary
(cmd format update)
 
(7 intermediate revisions by the same user not shown)
Line 2: Line 2:
==About==
==About==
Yes, I know, there's <code>find</code> and {{l/htyp|grep}} but I find those both opaque and difficult to use.
Yes, I know, there's <code>find</code> and {{l/htyp|grep}} but I find those both opaque and difficult to use.
==Options==
{{i/var/page|table.header|page=Futilities/human/options/base}}
{{i/var/page|table.rows}}
{{i/var/page|table.rows|page=Futilities/human/options/spider}}
{{i/var/page|table.rows|page=Futilities/human/options/base}}
</table>
==Examples==
==Examples==
Find all files in the Downloads folder which were created or edited on August 26, 2022:
* Find all files in my Downloads folder which were created or edited on August 26, 2022:
  ./ff -fd:2022-08-26 -sp /home/woozle/Downloads/*.*
  ./ff -fd:2022-08-26 -sp /home/woozle/Downloads/?"*.*"
: Note that the quotes are necessary in order to prevent [[htyp:bash/globbing|bash from automatically unglobbing]] the "*.*" into a list of filenames, which would hopelessly confuse things.
* Look in my home folder and find all files with "signal" in the name, and log all folders searched:
./ff -sp -lf:i=fo:f=folders.ff.log /home/woozle/?"*signal*"
: Note that this won't identify ''folders'' with "signal" in the name, which is actually what I wanted. This suggests that some tweaking may be needed, since <code>-lm:i=fo</code> should accomplish this but I don't think it does (not tested). Also, it's implied that matches and "found" can be written to separate logfiles, but I don't think it actually works that way. TO FIX.

Latest revision as of 16:55, 17 November 2022

FF: File Finder

About

Yes, I know, there's find and grep but I find those both opaque and difficult to use.

Options

name
standardlongshortmeaning
ff--case-sensitive -cs case must match (I think this is just filenames for now, but might also be content...)
ff--file-date= -fd= only include files created or edited on the given date
ff--list-matches -lm log matching files (same suboptions as -lf)
ff--show-commands -sc show any external commands used
spider--list-found=<params>-lf=<params> list all items found according to the rules in <params>, which is formatted like "<name>=<value>:<name>=<value>":
  • i=<what to include>: fi (file), fo (folder), or both
  • f=<filespec for output>
  • s: show on screen
base--config-file=<config spec>-cf=<config spec>name of config file to load instead of the default
base--show-progress-spupdate a line on the screen to show current activity

Examples

  • Find all files in my Downloads folder which were created or edited on August 26, 2022:
./ff -fd:2022-08-26 -sp /home/woozle/Downloads/?"*.*"
Note that the quotes are necessary in order to prevent bash from automatically unglobbing the "*.*" into a list of filenames, which would hopelessly confuse things.
  • Look in my home folder and find all files with "signal" in the name, and log all folders searched:
./ff -sp -lf:i=fo:f=folders.ff.log /home/woozle/?"*signal*"
Note that this won't identify folders with "signal" in the name, which is actually what I wanted. This suggests that some tweaking may be needed, since -lm:i=fo should accomplish this but I don't think it does (not tested). Also, it's implied that matches and "found" can be written to separate logfiles, but I don't think it actually works that way. TO FIX.