gdalmanage
What is gdalmanage?
gdalmanage is the GDAL command-line utility for identifying and performing file-system operations on raster datasets in a driver-aware way. Unlike cp, mv, or rm, it understands that some formats consist of several files (ERDAS IMG with sidecars, ENVI .hdr/.img, shapefile-like rasters, Arc/Info GRIDs) and moves, copies, or deletes all associated files as one unit.
gdalmanage <mode> [<format>] [options] <datasetname> [<newdatasetname>]Modes:
identify— report which driver recognises the datasetcopy— copy the dataset, including sidecar filesrename— rename the dataset, including sidecar filesdelete— delete the dataset, including sidecar files
Common options:
-r(withidentify) — recurse into directories-fr(withidentify) — force full driver scan-u(withidentify) — report uknown formats too
When would you use gdalmanage?
Use gdalmanage whenever you need safe, driver-aware file operations on rasters that may span multiple files. Typical jobs: deleting an ENVI raster and its sidecar .hdr without leaving orphans (gdalmanage delete scene.img), renaming an ERDAS IMAGINE file with its .aux and .rrd siblings intact (gdalmanage rename old.img new.img), or walking a directory tree to identify what GDAL drivers recognise each file (gdalmanage identify -r /data/archive).
For pipelines that discover unknown rasters, gdalmanage identify -r emits <path>: <driver> lines that are easy to grep and filter. The copy/rename/delete modes also respect driver-specific behaviour like VRT path updates, so they are strongly preferred over raw shell commands for any multi-file format.
FAQs
Why use gdalmanage instead of cp, mv, rm?
Plain shell tools don't know about sidecar files. A GeoTIFF's .tfw, .aux.xml, and .ovr are critical auxiliary files. An ENVI raster is a pair (.img + .hdr). Arc/Info grids are an entire directory. Using gdalmanage means no more orphan sidecars and no more broken references — it moves the whole logical dataset together.
Is gdalmanage delete reversible?
No. Like rm, it removes files from disk with no undo. Always ensure backups or version control before bulk-deleting through gdalmanage.
What's the difference between identify modes?
Plain identify calls only "Identify" for each driver (fast, header-based). -fr additionally calls "Open" for each driver, which is slower but handles formats whose Identify is weak. -u includes files GDAL doesn't recognise at all in the output, rather than silently skipping them. -r recurses a directory.
Does gdalmanage work on vector files?
No — it is raster-only. For vector formats, use ogrinfo to identify a layer's driver and the driver's own semantics (e.g. ogr2ogr -f "ESRI Shapefile" new.shp old.shp to "copy" all sidecars of a Shapefile).