Be very careful with these commands. You can cause serious damage to the map if you're not careful. It's not a matter of if you'll make a mistake, it's a matter of when.
#flattenDirt N E S W X Y
N = North, E = East, S = South, W = West, X = Extra distance below*, Y = Minimum dirt distance to rock
* Will cause the resulting flatten to happen X distance below the GM. Specify zero to work from the current height the GM is at. For best results stand on a flat tile.
#flattenRock N E S W X
N = North, E = East, S = South, W = West, X = Extra distance below