Porcupines are rodents of varying fur color that are characterized by their abundance of protruding spines, or quills, found all along the head and body of the animal. Some species have quills that extend from the tail, as well. They vary in size considerably: an adult Andean porcupine weighs roughly 2 kg (4.4 lb), while the crested porcupine can grow to weigh up to 27 kg (60 lb).

How long do they live?
Porcupines have relatively long lifespans and hold the record for being the longest-living rodent, with one individual named Cooper living over 32 years.

What do they feed on?
The North American porcupine is an herbivore and often climbs trees for food; it eats leaves, herbs, twigs, and green plants such as clover. In the winter, it may eat bark. The African porcupine is not a climber; instead, it forages on the ground. It is mostly nocturnal but sometimes forages for food during the day, eating bark, roots, fruits, berries, and farm crops. Porcupines have become a pest in Kenya and are eaten as a delicacy.

What are Defensive mechanism of a porcupine from predators?
Defense
edit
Defensive behaviour displays in a porcupine depend on sight, scent, and sound. Often, these displays are shown when a porcupine becomes agitated or annoyed. The four main displays seen in a porcupine are (in order from least to most aggressive) quill erection, teeth clattering, odour emission, and attack. A porcupine's colouring aids in part of its defence, as most of the predators are nocturnal and colour-blind. 
A porcupine's markings are black and white. The dark body and coarse hair of the porcupine are dark brown/black and when quills are raised, present a white strip down its back mimicking the look of a skunk. This, along with the raising of the sharp quills, deters predators. Along with the raising of the quills, porcupines clatter their teeth to warn predators not to approach. The incisors vibrate against each other, the strike zone shifts back, and the cheek teeth clatter. This behaviour is often paired with body shivering, which is used to further display the dangerous quills. The rattling of quills is aided by the hollow quills at the back end of the porcupine.
The use of odour is when the sight and sound have failed. An unpleasant scent is produced from the skin above the tail in times of stress and is often seen with a quill erection. If these processes fail, the porcupine attacks by running sideways or backwards into predators. A porcupine's tail can also be swung in the direction of the predator; if contact is made, the quills could be impaled into the predator, causing injury or death.

The Quills of a porcupine; 
Porcupines' quills, or spines, take on various forms depending on the species, but all are modified hairs coated with thick plates of keratin and are embedded in the skin musculature. Old World porcupines have quills embedded in clusters, whereas in New World porcupines, single quills are interspersed with bristles, underfur, and hair.

Quills are released by contact or may drop out when the porcupine shakes its body. New quills grow to replace lost ones. Despite what is commonly assumed and depicted in media, porcupines cannot launch their quills at range.

Some possible antibiotic properties are within the quills, specifically associated with the free fatty acids coating them. The antibiotic properties are believed to aid a porcupine that has suffered from self-injury.

Habitat of a porcupine.

Porcupines are slow-moving animals. All are social to some degree, though only Old World porcupines are known to form clans or family units.

Porcupines occupy a small range of habitats in tropical and temperate parts of Asia, Southern Europe, Africa, and North and South America. They live in forests and deserts, rocky outcrops, and hillsides. Some New World porcupines live in trees, but Old World porcupines prefer a rocky environment. Porcupines can be found on rocky areas up to 3,700 m (12,100 ft) high. They are generally nocturnal, but are occasionally active during daylight.

Porcupine Sexual behavior:
Porcupines mate very carefully to avoid injury from sharp quills. The female is fertile for only 8 to 12 hours a year. During courtship, the male sprays a high-pressure stream of urine on the female to signal interest, and she flattens her quills and lifts her tail if she accepts him.
Scent signals: The female releases scented mucus and urine to tell males she is ready.
Male battles: Multiple males fight and use their quills and teeth to win access to the female.The urine spray: The winning male approaches the female and shoots urine on her face to trigger her readiness.
Vocal sounds: Females make loud screams or cat-like sounds during this time.