  The classical way of extending an $[n, k, d]$ linear code $\C$ is to add an
overall parity-check coordinate to each codeword of the linear code $\C$. This
extended code, denoted by $\overline{\C}(-\bone)$ and called the standardly
extended code of $\C$, is a linear code with parameters $[n+1, k, \bar{d}]$,
where $\bar{d}=d$ or $\bar{d}=d+1$. This is one of the two extending techniques
for linear codes in the literature. The standardly extended codes of some
families of binary linear codes have been studied to some extent. However, not
much is known about the standardly extended codes of nonbinary codes. For
example, the minimum distances of the standardly extended codes of the
nonbinary Hamming codes remain open for over 70 years. The first objective of
this paper is to introduce the nonstandardly extended codes of a linear code
and develop some general theory for this type of extended linear codes. The
second objective is to study this type of extended codes of a number of
families of linear codes, including cyclic codes and nonbinary Hamming codes.
Four families of distance-optimal or dimension-optimal linear codes are
obtained with this extending technique. The parameters of certain extended
codes of many families of linear codes are settled in this paper.
