DOKK / manpages / debian 10 / grass-doc / g.mapset.1grass.en
g.mapset(1grass) Grass User's Manual g.mapset(1grass)

g.mapset - Changes/reports current mapset.
Optionally create new mapset or list available mapsets in given location.

general, settings

g.mapset
g.mapset --help
g.mapset [-clp] mapset=name [location=name] [dbase=path] [--overwrite] [--help] [--verbose] [--quiet] [--ui]


Create mapset if it doesn’t exist

List available mapsets and exit

Print current mapset and exit

Allow output files to overwrite existing files

Print usage summary

Verbose module output

Quiet module output

Force launching GUI dialog


Name of mapset (default: current search path)
Name of mapset where to switch

Location name
Location name (not location path)

GRASS GIS database directory
Default: path to the current GRASS GIS database

g.mapset changes the current working MAPSET, LOCATION, or GISDBASE. This is a fairly radical maneuver to run mid-session, take care when running the GUI at the same time.

With g.mapset, the shell history (i.e. .bash_history file of the initial location will be used to record the command history.

By default, the shell continues to use the history for the old mapset. To change this behaviour the history can be switched to record in the new mapset’s history file as follows:

# bash example
history -w
history -r /"$GISDBASE/$LOCATION/$MAPSET"/.bash_history
HISTFILE=/"$GISDBASE/$LOCATION/$MAPSET"/.bash_history

To print the name of the current mapset, use the -p command as shown below:

g.mapset -p

To list available mapsets, use the -l command as shown below:

g.mapset -l

This should list all the mapsets, such as: "landsat new PERMANENT user1."

To change the current mapset to "user1" use the following command:

g.mapset mapset=user1 location=nc_spm_08_grass7

You should receive the following message: "Mapset switched. Your shell continues to use the history for the old mapset."

To create a new mapset, use the -c tag as shown below:

g.mapset -c mapset=new location=nc_spm_08_grass7

g.gisenv, g.mapsets

Radim Blazek

Last changed: $Date: 2017-12-30 12:13:03 +0100 (Sat, 30 Dec 2017) $

Available at: g.mapset source code (history)

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

© 2003-2019 GRASS Development Team, GRASS GIS 7.6.0 Reference Manual

GRASS 7.6.0