I have a bunch of files on a GRASS location, all named temp_something, that I want to delete. I tried to use the g.remove tool using the multiple option and typing temp* in, but it doesn't work out, and a character * not allowed error is reported.

Am I doing something wrong or is there just no way GRASS works with wildcards?

  • Have you tried something like g.mremove -f rast=temp* ? – countryman Feb 4 '16 at 17:47
  • I'm afraid <i>g.mremove</i> has been deprecated and is now an option of the standard g.remove command as I get : command not found from the command line. – sig_renato Feb 4 '16 at 17:57
  • 1
    Right, this is a GRASS 6.4.3. command. Glad you found the solution! – countryman Feb 5 '16 at 7:05

I had success by using g.remove -f type=vector pattern="temp*"

It turns out, when intending to remove multiple files based on their names and making use of wildcards, one uses the pattern parameter and not the name.

  • 1
    The name option can be used with multiple names when you already know the names of maps to remove: ... name=raster1,raster2,raster3 ... – wenzeslaus Feb 9 '16 at 0:33
  • 1
    Indeed. Now I use name when the files names' have little in common, as in: DEM_azores; raster_hillshade; pop_ilhas. – sig_renato Feb 9 '16 at 0:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.