On Mon, 18 Apr 2022, Michael Barnes wrote:

Now I want to copy all those files into a new directory. I've tried
various combinations of pipe to something, but no joy.

Michael,

I'm not as knowledgable as Russell or Galen but your question interests me
so I looked on my Slackware system's locate man page. Slackware uses
slocate, the secure version of GNU's locate command.

Most options refer to the databases to be searched; there is no -0 option,
but there is -i. More to the point of your question is this option:
 -o <file>
              --output=<file> Specfies the database to create.
I interpret this option as allowing you to create a file with the output of
the locate command's results.

That written, on my system I can use the standard output redirection symbol,
'>' to write locate's output to a file. I tested this by:
locate stormwater > temp.out
and the temp.out file contains 112 files with that string in their name;
examples:
/data1/eis-examples/rosemont-cu/figures/storm-water/barrel_stormwater.shp
/data1/eis-examples/rosemont-cu/figures/storm-water/barrel_stormwater.shp.xml
/data1/eis-examples/rosemont-cu/figures/storm-water/mpo_stormwater.shp
/data1/eis-examples/rosemont-cu/figures/storm-water/barrel_stormwater.shx
/data1/eis-examples/rosemont-cu/figures/storm-water/phased_stormwater.shx
/data1/eis-examples/rosemont-cu/figures/storm-water/mpo_stormwater.sbn
/data1/eis-examples/rosemont-cu/figures/storm-water/mpo_stormwater.prj

Woiks for me. :-)

HTH,

Rich

Reply via email to