  In this paper, based on the theory of defining sets, two classes of at most
six-weight linear codes over $\mathbb{F}_p$ are constructed. The weight
distributions of the linear codes are determined by means of Gaussian period
and Weil sums. In some case, there is an almost optimal code with respect to
Griesmer bound, which is also an optimal one according to the online code
table. The linear codes can also be employed to get secret sharing schemes.
