Linear codes may have a few weights if their defining sets are chosen properly. Let s and t be positive integers. For an odd prime p and an even integer m, let q = p m , m = 2s and Tr m (resp. Tr s ) be the absolute trace function from F q (resp. F p s ) to F p . In this paper, we defineBy employing exponential sums, we demonstrate the complete weight enumerators of a class of p-ary linear codes given byThen we get their weight enumerators explicitly, which will give us several linear codes with a few weights. The presented codes are suitable with applications in secret sharing schemes.INDEX TERMS Linear code, complete weight enumerator, Gauss sum, cyclotomic number.