All porcupines are nocturnal and have a great sense of smell. To make quick work of available food, these herbivores have sharp, chisel-like front teeth. Old World porcupines eat bark, roots, fruits, and berries. In rural areas, they may eat farmed crops, such as groundnuts, potatoes, pumpkins, and melons.
New World porcupines eat primarily pine needles and bark, roots, stems, leaves, berries, meadow grass, seeds, flowers, nuts, aquatic vegetation, fruits, and tubers. Some have been known to take fruit and corn from plantations, and the North American porcupine has earned a bad reputation for killing timber and ornamental trees by stripping bark from the trunks.
Porcupines may gnaw on bones to sharpen their teeth and to get salt at the same time. On occasion, porcupines have been known to eat insects and small lizards. At the San Diego Zoo and the San Diego Zoo Safari Park, porcupines may be fed yams, corn, apples, and greens as well as herbivore pellets.