123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <h2>DESCRIPTION</h2>
- <em>g.list</em> searches for data files matching a pattern given by
- wildcards or POSIX Extended Regular Expressions.
- <h2>NOTES</h2>
- The output of <em>g.list</em> may be useful for other programs' parameter
- input (e.g. time series for <em><a href="r.series.html">r.series</a></em>)
- when used with <em>separator=comma</em>.
- <h2>EXAMPLES</h2>
- List all raster maps as continuous, sorted list:
- <div class="code"><pre>
- g.list type=rast
- </pre></div>
- List all vector maps as continuous, sorted list with MAPSET info (i.e.
- fully-qualified map names):
- <div class="code"><pre>
- g.list type=vector -m
- </pre></div>
- List all raster and vector maps ordered by mapset:
- <div class="code"><pre>
- g.list type=raster -p
- </pre></div>
- List all raster and vector maps as continuous, sorted list:
- <div class="code"><pre>
- g.list type=rast,vect
- </pre></div>
- List all available GRASS data base files:
- <div class="code"><pre>
- g.list type=all
- </pre></div>
- <h3>Mapset search path</h3>
- If <b>mapset</b> is not specified, then <em>g.list</em> searches for
- data files in the mapsets that are included in the search path
- (defined by <em><a href="g.mapsets.html">g.mapsets</a></em>).
- See <tt>g.mapsets -p</tt>.
- <div class="code"><pre>
- g.list rast -p
- raster map(s) available in mapset <user1>:
- dmt
- ...
- raster map(s) available in mapset <PERMANENT>:
- aspect
- ...
- </pre></div>
- Option <b>mapset</b>=. (one dot) lists only data files from
- the current mapset:
- <div class="code"><pre>
- g.list rast mapset=.
- ...
- </pre></div>
- <!-- better quote * as "*"? -->
- Similarly, <b>mapset</b>=* (one asterisk) prints data files from all
- available mapsets also including those that are not listed in the
- current search path (see <tt>g.mapsets -l</tt>).
- <div class="code"><pre>
- 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
- ...
- </pre></div>
- <h3>Wildcards</h3>
- List all vector maps starting with letter "r":
- <div class="code"><pre>
- g.list type=vector pattern="r*"
- </pre></div>
- List all vector maps starting with letter "r" or "a":
- <div class="code"><pre>
- g.list type=vector pattern="[ra]*"
- </pre></div>
- List all raster maps starting with "soil_" or "landuse_":
- <div class="code"><pre>
- g.list type=raster pattern="{soil,landuse}_*"
- </pre></div>
- List certain raster maps with one variable character/number:
- <div class="code"><pre>
- g.list type=raster pattern="N45E00?.meters"
- </pre></div>
- Use of <b>exclude</b> parameter:
- <div class="code"><pre>
- # 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
- </pre></div>
- <h3>Regular expressions</h3>
- List all soil maps starting with "soils" in their name:
- <div class="code"><pre>
- g.list -r type=raster pattern='^soils'
- </pre></div>
- List "tmp" if "tmp" raster map exists:
- <div class="code"><pre>
- g.list -r type=raster pattern='^tmp$'
- </pre></div>
- List "tmp0" ..."tmp9" if corresponding vector map exists
- (each map name linewise):
- <div class="code"><pre>
- g.list -r type=vector pattern='^tmp[0-9]$'
- </pre></div>
- List "tmp0"..."tmp9" if corresponding vector map exists
- (each map name comma separated):
- <div class="code"><pre>
- g.list -r type=vector separator=comma pattern='^tmp[0-9]$'
- </pre></div>
- <h3>Extended regular expressions</h3>
- List all precipitation maps for the years 1997-2012, comma separated:
- <div class="code"><pre>
- g.list -e type=raster separator=comma pattern="precip_total.(199[7-9]|200[0-9]|201[0-2]).sum"
- </pre></div>
- <h3>Maps whose region overlaps with a saved region</h3>
- List all raster maps starting with "tmp_" whose region overlaps with
- the region of "test" raster map:
- <div class="code"><pre>
- g.region raster=test save=test_region
- g.list type=raster pattern='tmp_*' region=test_region
- </pre></div>
- List "tmp0"..."tmp9" vector maps whose region overlaps with
- the current region:
- <div class="code"><pre>
- g.list -r type=vector pattern='^tmp[0-9]$' region=.
- </pre></div>
- List all raster and vector maps whose region overlaps with the default region
- of the PERMANENT mapset in the current location (DEFAULT_WIND):
- <div class="code"><pre>
- g.list type=rast,vect region=*
- </pre></div>
- Note that, without <tt>region=*</tt>, <tt>g.list type=rast,vect</tt> simply
- lists all available raster and vector maps from the current search path
- regardless of their region.
- <h2>SEE ALSO</h2>
- <em>
- <a href="r.series.html">r.series</a>,
- <a href="t.list.html">t.list</a>,
- <a href="t.rast.list.html">t.rast.list</a>,
- <a href="t.vect.list.html">t.vect.list</a>
- </em>
- <p>
- <a href="http://en.wikipedia.org/wiki/Regular_expression">Regular expressions</a>
- (aka regex) - from Wikipedia, the free encyclopedia
- <h2>AUTHOR</h2>
- Huidae Cho<br>
- grass4u@gmail.com
- <br>
- based on general/manage/cmd/list.c by Michael Shapiro
|