g.rename(1)

πŸ’… g.rename β€” the GRASS GIS glow-up page πŸ’…

okay bestie, welcome to g.rename(1) from the GRASS GIS User's Manual. this is the one that gives your files a whole new name and a whole new identity. main character rebrand energy, no cap. πŸŽ€


✨ NAME ✨

g.rename β€” renames data base element files in the user's current mapset. literally just that. a rename. a rebrand. a slay. πŸ’–


🏷️ KEYWORDS 🏷️

general, map management, rename


🌈 SYNOPSIS 🌈

g.rename
g.rename --help
g.rename  [raster=from,to]   [raster_3d=from,to]   [vector=from,to]
[label=from,to]   [region=from,to]   [group=from,to]   [--overwrite]
[--help]  [--verbose]  [--quiet]  [--ui]

🚩 Flags 🚩

  • --overwrite β€” bestie this one lets output files straight-up overwrite files that already exist. yes it's giving bold. yes you should think about it first. πŸ™ˆ
  • --help β€” prints the usage summary so you're not out here guessing.
  • --verbose β€” verbose module output, aka the module tells you everything it's doing.
  • --quiet β€” quiet module output, aka shhh, no commentary, just vibes.
  • --ui β€” forces the GUI dialog to launch. for when you want the pretty buttons. ✨

πŸŽ€ Parameters πŸŽ€

  • raster=from,to β€” raster map(s) to be renamed.
  • raster_3d=from,to β€” 3D raster map(s) to be renamed.
  • vector=from,to β€” vector map(s) to be renamed.
  • label=from,to β€” paint label file(s) to be renamed.
  • region=from,to β€” region definition(s) to be renamed.
  • group=from,to β€” imagery group(s) to be renamed.

πŸ’– DESCRIPTION πŸ’–

so here's the tea. g.rename lets you rename data base element files in the user's current mapset. that's the whole job. the way that it just... does it. πŸ‘‘

you can hand g.rename every single thing it needs right there on the command line by specifying:

  • the type of data base element to be renamed β€” one or more of: raster, raster_3d, vector, icon, labels, region, and group;
  • the specific file element in the current mapset to be renamed (the old one); and
  • the new name to be assigned to this file element (the new one) in the current mapset.

then the file element old gets renamed to new. that's it. glow-up complete. πŸ¦‹

and if you're feeling lazy (valid), you can just type g.rename --help with no arguments on the command line and get a menu of existing data base element types and files to choose from for possible renaming:

       raster   raster map(s) to be renamed
    raster_3d   3D raster map(s) to be renamed
       vector   vector map(s) to be renamed
       labels   paint label file(s) to be renamed
       region   region definition(s) to be renamed
        group   imagery group(s) to be renamed

πŸ“ NOTES πŸ“

if a data base element has support files (which, lowkey, is super common with raster maps), those support files get renamed too. they're a package deal. they move as a unit. periodt. πŸ’…

not me trying to rename a file to itself 😭 if you set the new file name equal to the old file name (like, for example, g.rename raster=soils,soils), g.rename will not execute the rename β€” it'll just say that no rename is needed. iconic honestly. however, g.rename will let you overwrite other existing files in the current mapset by making the new file name that of an already existing file. so like, be aware. that's a whole thing. πŸ’€

for portability reasons, g.rename is ignoring case of names. so if you wanna change the case of a map name, here's the two-step: first rename the map to a name which differs by more than case, then rename it to the intended name. two renames. a little journey. you got this. 🫢


🌸 EXAMPLE 🌸

# rename raster map
g.rename raster=oldrast,newrast
# rename vector map
g.rename vector=oldvect,newvect
# combined renaming
g.rename raster=oldrast,newrast vector=oldvect,newvect

look at that combined renaming at the end. multi-tasking. efficiency. ate. πŸ”₯


πŸ‘€ SEE ALSO πŸ‘€

g.copy, g.list, g.remove


πŸ‘‘ AUTHOR πŸ‘‘

Michael Shapiro, U.S.Army Construction Engineering Research Laboratory


πŸ”— SOURCE CODE πŸ”—

Available at: g.rename source code (history)

Accessed: Saturday Jan 17 05:40:40 2026

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


and that's a wrap bestie!! this page is from GRASS GIS 8.4.2, page g.rename(1), Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual, last accessed Saturday Jan 17 05:40:40 2026. go rename something cute. mwah. πŸ’‹πŸ’–βœ¨

πŸ“¦ where this page comes from