g.list1grass
Lists available grass data base files of the user-specified data type optionally using the search pattern.
Usage
g.list
g.list --help
g.list [-iretmpf]
type=datatype
[,datatype, ...]
[pattern=string]
[exclude=string]
[mapset=name
[,name, ...]]
[separator=character]
[region=name]
[output=name]
[--overwrite]
[--help]
[--verbose]
[--quiet]
[--ui]
Keywords
general, map management, list, search
Overview
g.list searches for data files matching a pattern given by wildcards or POSIX Extended Regular Expressions.
Notes
The output of g.list may be useful for other programs’ parameter input (e.g. time series for r.series) when used with separator=comma.
Examples
List all raster maps as continuous, sorted list:
g.list type=rast
List all vector maps as continuous, sorted list with MAPSET info (i.e. fully-qualified map names):
g.list type=vector -m
List all raster and vector maps ordered by mapset:
g.list type=raster -p
List all raster and vector maps as continuous, sorted list:
g.list type=rast,vect
List all available GRASS data base files:
g.list type=all
Mapset search path
If mapset is not specified, then g.list searches for data files in the mapsets that are included in the search path (defined by g.mapsets). See g.mapsets -p.
g.list rast -praster map(s) available in mapset <user1>:dmt...raster map(s) available in mapset <PERMANENT>:aspect...
Option mapset=. (one dot) lists only data files from the current mapset:
g.list rast mapset=....
Similarly, mapset=* (one asterisk) prints data files from all available mapsets also including those that are not listed in the current search path (see g.mapsets -l).
g.list rast mapset=* -praster map(s) available in mapset <landsat>:lsat5_1987_10...raster map(s) available in mapset <user1>:dmt...raster map(s) available in mapset <PERMANENT>:aspect...
Wildcards
List all vector maps starting with letter "r":
g.list type=vector pattern="r*"
List all vector maps starting with letter "r" or "a":
g.list type=vector pattern="[ra]*"
List all raster maps starting with "soil_" or "landuse_":
g.list type=raster pattern="{soil,landuse}_*"
List certain raster maps with one variable character/number:
g.list type=raster pattern="N45E00?.meters"
Use of exclude parameter:
# without exclude:g.list rast pat="r*" mapset=PERMANENTrailroadsroadsrstrct.areasrushmore# exclude only complete word(s):g.list rast pat="r*" exclude=roads mapset=PERMANENTrailroadsrstrct.areasrushmore# exclude with wildcard:g.list rast pat="r*" exclude="*roads*" mapset=PERMANENTrstrct.areasrushmore
Regular expressions
List all soil maps starting with "soils" in their name:
g.list -r type=raster pattern=’^soils’
List "tmp" if "tmp" raster map exists:
g.list -r type=raster pattern=’^tmp$’
List "tmp0" ..."tmp9" if corresponding vector map exists (each map name linewise):
g.list -r type=vector pattern=’^tmp[0-9]$’
List "tmp0"..."tmp9" if corresponding vector map exists (each map name comma separated):
g.list -r type=vector separator=comma pattern=’^tmp[0-9]$’
Extended regular expressions
List all precipitation maps for the years 1997-2012, comma separated:
g.list -e type=raster separator=comma pattern="precip_total.(199[7-9]|200[0-9]|201[0-2]).sum"
Maps whose region overlaps with a saved region
List all raster maps starting with "tmp_" whose region overlaps with the region of "test" raster map:
g.region raster=test save=test_regiong.list type=raster pattern=’tmp_*’ region=test_region
List "tmp0"..."tmp9" vector maps whose region overlaps with the current region:
g.list -r type=vector pattern=’^tmp[0-9]$’ region=.
List all raster and vector maps whose region overlaps with the default region of the PERMANENT mapset in the current project (DEFAULT_WIND):
g.list type=rast,vect region=*
Note that, without region=*, g.list type=rast,vect simply lists all available raster and vector maps from the current search path regardless of their region.
Source code
Available at: g.list source code (history)
Accessed: Monday Feb 24 17:50:29 2025
Main index | General index | Topics index | Keywords index | Graphical index | Full index
© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual
Releases
10 releases since Debian 4.0 (Etch); the text changed 9 times.