  Linear codes are widely studied in coding theory as they have nice
applications in distributed storage, combinatorics, lattices, cryptography and
so on. Constructing linear codes with desirable properties is an interesting
research topic. In this paper, based on the augmentation technique, we present
two families of linear codes from some functions over finite fields. The first
family of linear codes is constructed from monomial functions over finite
fields. The locality of them is determined and the weight distributions of two
subfamilies of the codes are also given. An infinite family of locally
recoverable codes which are at least almost optimal and some optimal
recoverable codes are obtained from the linear codes. In particular, the two
subfamilies of the codes are proved to be both optimally or almost optimally
extendable and self-orthogonal. The second family of linear codes is
constructed from weakly regular bent functions over finite fields and their
weight distribution is determined. This family of codes is proved to have
locality 3 for some cases and is conjectured to have locality 2 for other
cases. Particularly, two families of optimal locally recoverable codes are
derived from the linear codes. Besides, this family of codes is also proved to
be both optimally or almost optimally extendable and self-orthogonal.
