g.remove(1grass)

✨ g.remove ✨

okay bestie, welcome to the g.remove page from the GRASS User's Manual (that's g.remove(1grass) if you're being formal πŸ’…). This is the one that deletes data base element files out of your current mapset using a search pattern. Big main character energy. Cleaning up your mapset is self care, fr fr 🧹✨


🌸 KEYWORDS 🌸

general, map management, remove

like... the vibe is literally in the keywords. it's giving "spring cleaning" πŸ¦‹


πŸ‘‘ SYNOPSIS πŸ‘‘

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

πŸŽ€ Flags πŸŽ€

  • -i β€” ignore case, bestie. TMP_1 and tmp_1 are the same girl now πŸ™ˆ
  • -r β€” use basic regular expressions instead of wildcards
  • -e β€” use extended regular expressions instead of wildcards
  • -f β€” force removal β€” and like, this one is not optional-optional, it's required for actual deletion of files 😭 no -f, no delete, that's the rule
  • -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 have to tell her what to remove
    • 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, just say their names bestie
  • 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 given by wildcards or POSIX Extended Regular Expressions. she's flexible like that ✨

but here's the plot twist that saves your whole life: if the -f force flag is not given, then nothing is removed. instead, the list of selected file names gets printed to stdout as a preview of the files that would be deleted. it's a vibe check before the actual vibe check. literally the safest energy. so you can peek at what's about to get deleted before you commit πŸ’€βž‘οΈπŸ«Ά


πŸ”₯ 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"

see how the first tmp_ one runs without -f first?? that's the "look before you leap" moment and honestly it ate πŸ‘‘


πŸ’œ AUTHOR πŸ’œ

Huidae Cho grass4u@gmail.com


⭐ SOURCE CODE ⭐

Available at: g.remove source code (history)

Latest change: Thursday May 08 14:35:40 2025 in commit: 9528b1e38ba37992c1597a979dc3efbb07b74ec5

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


and that's the whole page bestie 🫢© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual, GRASS 8.5.0, g.remove(1grass) β€” slay, go clean that mapset, but run it without -f first, iykyk πŸ’…πŸŒΈ

πŸ“¦ where this page comes from