g.list(1grass)

✨ NAME ✨

okay so bestie, meet g.list β€” the page you're reading is officially g.list(1grass) out of the GRASS User's Manual, and her whole personality is this: she lists available GRASS data base files of the user-specified data type, and if you want, she'll do it with a search pattern too. literally the friend who can find anything in the receipts πŸ’–


🌸 KEYWORDS 🌸

general, map management, list, search β€” that's the vibe check, and she passes it πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

g.list
g.list --help
g.list [-iretmpf] type=datatype[,datatype,...]  [pattern=string]
[exclude=string]   [mapset=name[,name,...]]   [separator=character]
[region=name]   [output=name]   [format=name]   [--overwrite]  [--help]
[--verbose]  [--quiet]  [--ui]

πŸŽ€ Flags πŸŽ€

  • -i β€” ignore case, bestie. she's not gonna be picky about your caps 🫢
  • -r β€” use basic regular expressions instead of wildcards. glow up from wildcards, gorgeous ✨
  • -e β€” use extended regular expressions instead of wildcards. even MORE regex energy πŸ”₯
  • -t β€” print data types. she tells you what each thing is, not just its name πŸ‘‘
  • -m β€” print fully-qualified map names (including mapsets). no more "which mapset tho" mystery 🌈
  • -p β€” pretty printing in human readable format [deprecated]
🚨 this flag is deprecated and will be removed in a future release. the plain format will become the default. use format="plain" to set it explicitly in a script. ok so like, stop using it, fr fr 😭
  • -f β€” verbose listing (also list map titles) [deprecated]
🚨 this flag is deprecated and will be removed in a future release. use the type-specific tool to obtain metadata, such as r.info and v.info. she's moving on, and honestly? valid πŸ’…
  • --overwrite β€” allow output files to overwrite existing files (chaotic, but consensual)
  • --help β€” print usage summary. the "what does this even do" button πŸ™ˆ
  • --verbose β€” verbose module output. she talks more, you learn more πŸ¦‹
  • --quiet β€” quiet module output. she whispers. minimalism era πŸŽ€
  • --ui β€” force launching GUI dialog. for the girlies who need a window 🌸

πŸ’œ Parameters πŸ’œ

  • type=datatype[,datatype,...] [required] β€” data type(s). 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
  • pattern=string β€” map name search pattern (default: all)
  • exclude=string β€” map name exclusion pattern (default: none). the "not you, girl" filter πŸ’€
  • mapset=name[,name,...] β€” name of mapset to list (default: current search path). ’.’ for current mapset; ’*’ for all mapsets in location
  • separator=character β€” field separator. special characters: pipe, comma, space, tab, newline. default: newline
  • region=name β€” name of saved region for map search (default: not restricted). ’.’ for current region; ’*’ for default region
  • output=name β€” name for output file. if not given or ’-’ then standard output
  • format=name β€” output format. options: plain, shell, json
    • plain: Human readable text output
    • shell: shell script style text output
    • json: JSON (JavaScript Object Notation)

πŸ’œ DESCRIPTION πŸ’œ

g.list searches for data files matching a pattern given by wildcards or POSIX Extended Regular Expressions. that's it, that's the whole serve. periodt ✨


πŸŽ€ 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. she's not just pretty, she's interoperable πŸ’…


⭐ 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 -p
raster 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=* -p
raster 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=PERMANENT
  railroads
  roads
  rstrct.areas
  rushmore
# exclude only complete word(s):
  g.list rast pat="r*" exclude=roads mapset=PERMANENT
  railroads
  rstrct.areas
  rushmore
# exclude with wildcard:
  g.list rast pat="r*" exclude="*roads*" mapset=PERMANENT
  rstrct.areas
  rushmore

πŸ’– 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_region
g.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.

πŸ”₯ SEE ALSO πŸ”₯

r.series, t.list, t.rast.list, t.vect.list

Regular expressions (aka regex) - from Wikipedia, the free encyclopedia


πŸ‘‘ AUTHOR πŸ‘‘

Huidae Cho grass4u@gmail.com based on general/manage/cmd/list.c by Michael Shapiro


🌈 SOURCE CODE 🌈

Available at: g.list source code (history)

Latest change: Thursday Oct 02 14:39:13 2025 in commit: 1850489bf42c72d8dcfe2e4db1738441b4a7dc43

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

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


and that's the whole page babes 🫢 GRASS 8.5.0, signed off on Thursday Oct 02 14:39:13 2025 β€” she served, she listed, she left no map behind. go run her, bestie, you're gonna eat πŸ’…βœ¨πŸ“

πŸ“¦ where this page comes from