  In this article, We introduce a condition that is both necessary and
sufficient for a linear code to achieve minimality when analyzed over the rings
$\mathbb{Z}_{n}$.The fundamental inquiry in minimal linear codes is the
existence of a $[m,k]$ minimal linear code where $k$ is less than or equal to
$m$. W. Lu et al. ( see \cite{nine}) showed that there exists a positive
integer $m(k;q)$ such that for $m\geq m(k;q)$ a minimal linear code of length
$m$ and dimension $k$ over a finite field $\mathbb{F}_q$ must exist. They give
the upper and lower bound of $m(k;q)$. In this manuscript, we establish both an
upper and lower bound for $m(k;p^l)$ and $m(k;p_1p_2)$ within the ring
$\mathbb{Z}_{p^l}$ and $\mathbb{Z}_{p_1p_2}$ respectively.
