I need to rename the field names (attributes) in a shapefile. Is there an easy way to do this from the command line?
ogr2ogr outputfile.shp inputfile.shp -sql "SELECT oldfield1 AS newfield1, oldfield2 AS newfield2 from inputfile"
As an added bonus, you can convert the data into a different format at the same time, or filter your data by specifying a where clause. Note that you will need to specify all output fields if you use this method (any fields not included in the SELECT statement will be dropped from the output file).