g.remove(1)

πŸ’– g.remove β€” the GRASS GIS manual page, bestie edition πŸ’–

okay so this is g.remove(1), straight out of the GRASS GIS User's Manual. yes it's a manual page. no it's not boring. sit down, hydrate, let's go 🫢


✨ NAME ✨

g.remove β€” removes data base element files from the user's current mapset using the search pattern. that's it, that's the whole job, and it does it flawlessly πŸ’…


🏷️ KEYWORDS 🏷️

general, map management, remove


πŸŽ€ SYNOPSIS πŸŽ€

g.remove
g.remove --help
g.remove [-irefb] type=datatype[,datatype,...]
[ignore=string[,string,...]]
[pattern=string]   [exclude=string]   [--help]  [--verbose]  [--quiet]
[--ui]

🌸 Flags 🌸

  • -i β€” ignore case. capital letters? lowercase letters? it does not care, it's above such things πŸ’…
  • -r β€” use basic regular expressions instead of wildcards
  • -e β€” use extended regular expressions instead of wildcards
  • -f β€” force removal. and bestie, this one is the real one: it's required for actual deletion of files. no -f, no delete. periodt.
  • -b β€” remove base raster maps
  • --help β€” print usage summary
  • --verbose β€” verbose module output
  • --quiet β€” quiet module output
  • --ui β€” force launching GUI dialog

🧚 Parameters 🧚

  • type=datatype[,datatype,...] β€” [required] the data type(s) you're coming for.
    • Options: raster, raster_3d, vector, label, region, group, all
    • raster: raster map(s)
    • raster_3d: 3D raster map(s)
    • vector: vector map(s)
    • label: paint label file(s)
    • region: region definition(s)
    • group: imagery group(s)
    • all: all types
  • name=string[,string,...] β€” name of file(s) to remove
  • ignore=string[,string,...] β€” name of file(s) to ignore (default: none)
  • pattern=string β€” file name search pattern
  • exclude=string β€” file name exclusion pattern (default: none)

πŸ’œ DESCRIPTION πŸ’œ

so g.remove removes data files matching a pattern, and that pattern can be either wildcards or POSIX Extended Regular Expressions. you pick your fighter πŸ₯Š

and here's the plot twist: if you do not pass the -f force flag, nothing gets removed. instead the list of selected file names gets printed to stdout as a preview of the files that would be deleted. it's giving window shopping. it's giving "let me think about it". iconic behaviour tbh 🌈


πŸ”₯ EXAMPLES πŸ”₯

Delete map1 and map2 raster maps in the current mapset:

g.remove -f type=raster name=tmp1,tmp2

Delete all raster and vector maps starting with "tmp_" in the current mapset:

# show matching raster and vector maps but do not delete yet (as verification)
g.remove type=raster,vector pattern="tmp_*"
# actually delete the matching raster and vector maps
g.remove -f type=raster,vector pattern="tmp_*"

Delete all vector maps starting with "stream_" in the current mapset, but exclude those ending with "_final":

g.remove -f type=vector pattern="stream_*" exclude="*_final"

πŸ‘‘ AUTHOR πŸ‘‘

Huidae Cho grass4u@gmail.com


⭐ SOURCE CODE ⭐

Available at: g.remove source code (history)

Accessed: Saturday Jan 17 05:40:40 2026

Main index | General index | Topics index | Keywords index | Graphical index | Full index


okay and for the cute sign-off πŸŽ€ β€” this whole thing lives under the GRASS GIS 8.4.2 Reference Manual, Β© 2003-2025 GRASS Development Team, and yeah the version stamp says GRASS 8.4.2 with g.remove(1) chillin' at the bottom. now go forth and delete responsibly, bestie, and remember: no -f, no files gone πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from