A Library in Linux A library is a collection of pre-compiled pieces of code called functions . The library contains common functions and together, they form a package called — a library. Functions are blocks of code that get reused throughout the program. Using the pieces of code again in a program saves time.