Scroll to navigation

g.mapset(1grass) GRASS User's Manual g.mapset(1grass)

NAME

g.mapset - Changes or reports current mapset.
Optionally, creates new mapset or lists available mapsets in given project (location).

KEYWORDS

general, settings, project

SYNOPSIS

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

Flags:


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

Parameters:


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

Project (location) name
Project name (not path to project)

GRASS database directory
Default: path to the current GRASS database

Output format
Options: plain, json
Default: plain
plain: Plain text output
json: JSON (JavaScript Object Notation)

DESCRIPTION

g.mapset changes the current working mapset, project (formerly known as location), or GISDBASE (directory with one or more projects).

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

NOTES

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

EXAMPLES

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

g.mapset -p

List available mapsets

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."

Change the current mapset

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

g.mapset mapset=user1 project=nc_spm_08_grass7

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

Create a new mapset

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

g.mapset -c mapset=new project=nc_spm_08_grass7

SEE ALSO

g.gisenv, g.mapsets

AUTHOR

Radim Blazek

SOURCE CODE

Available at: g.mapset source code (history)

Latest change: Monday Oct 13 16:40:43 2025 in commit: ae1f0dd12744249f59f72f6779bd9612fc17a00e

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

© 2003-2026 GRASS Development Team, GRASS 8.5.0RC1 Reference Manual

GRASS 8.5.0RC1