Shorepower

Shore power or shore supply is the provision of shoreside electrical power to a ship at berth while its main and auxiliary engines are shut down. While the term denotes shore as opposed to off-shore, it is sometimes applied to aircraft or land-based vehicles (such as campers, heavy trucks with sleeping compartments and tour buses), which may plug into grid power when parked for idle reduction. 
The source for land-based power may be grid power from an electric utility company, but also possibly an external remote generator. These generators may be powered by diesel or renewable energy sources such as wind or solar.
Shore power saves consumption of fuel that would otherwise be used to power vessels while in port, and eliminates the air pollution associated with consumption of that fuel. A port city may have anti-idling laws that require ships to use shore power. Use of shore power may facilitate maintenance of the ship's engines and generators, and reduces noise.
Oceangoing ships.
"Cold ironing" is specifically a shipping industry term that came into use when all ships had coal-fired engines. When a ship tied up at port, there was no need to continue to feed the fire and the iron engines would literally cool down, eventually going completely cold – hence the term "cold ironing". If commercial ships can use shore-supplied power for services such as cargo handling, pumping, ventilation and lighting while in port, they need not run their own diesel engines, reducing air pollution emissions.
Small craft.
On small private boats, the power supply used is usually the same as regular household electric power. Some small craft may not need electric power while docked, or may replace on-board generators (if any) with solar panels sufficient to run a small battery-operated system. Boats that are connected to shorepower only need sufficient battery capacity to last until the next shorepower connection.
Batteries on a vessel may be used to power an inverter to produce AC, which can be used for appliances that require AC power.
Trucks.
Shore power, as it relates to the trucking industry, is commonly referred to as "Truck Stop Electrification" (TSE). The US Environmental Protection Agency estimates that trucks plugging in versus idling on diesel fuel could save as much as $3240 annually. There are currently 138 truck stops in the USA that offer on-board systems (also called Shore power) or off-board systems (also called single system electrification) for an hourly fee.
Auxiliary power units offer another alternative to both idling and shore power for trucks.
Aircraft.
Similar to shore power for ships, a ground power unit (GPU) may be used to supply electric power for an aircraft on the ground, to sustain interior lighting, ventilation and other requirements before starting of the main engines or the aircraft auxiliary power unit (APU). It is also used by aircraft with APUs if the airport authority does not permit the usage of APUs at its docks or if the carrier wishes to save on the use of jet fuel (which APUs use). This may be a self-contained engine-generator set, or it may convert commercial power to the voltage and frequency needed for the aircraft (for example 115 V 400 Hz).
Trains and buses.
Shorepower may be a grid connection for passenger trains laying over between runs. Similarly buses may be connected when not in use.