Penknife, or pen knife, is a British English term for a small folding knife.  Today the word penknife is the common British English term for both a pocketknife, which can have single or multiple blades, and for multi-tools, with additional tools incorporated into the design. 
Originally, penknives were used for thinning and pointing quills (cf. penna, Latin for feather) to prepare them for use as dip pens and, later, for repairing or re-pointing the nib.  A penknife might also be used to sharpen a pencil,  prior to the invention of the pencil sharpener. In the mid-1800s, penknives were necessary to slice the uncut edges of newspapers and books. 
A penknife did not necessarily have a folding blade, but might resemble a scalpel or chisel by having a short, fixed blade at the end of a long handle. One popular (but incorrect) folk etymology makes an association between the size of a penknife and that of a small ballpoint pen.
During the 20th century there has been a proliferation of multi-function knives with assorted blades and gadgets, including; awls, reamers, scissors, nail files, corkscrews, tweezers, toothpicks, and so on. The tradition continues with the incorporation of modern devices such as ballpoint pens, LED torches/flashlights, and USB flash drives. 
The most famous example of a multi-function penknife is the Swiss Army knife, some versions of which number dozens of functions and are really more of a folding multi-tool, incorporating a blade or two, than a penknife with extras. 
upon your knee with the back of a penknife,
As he came along in the train, he had been sharpening a pencil, and the sudden jolt of the engine as it drew up at a station had driven the penknife against his face...