2. Given that $f(x)$ is a periodic function on $\mathbf{R}$ with the smallest positive period of 2, and when $0 \leqslant x<2$, $f(x)=x^{3}-x$. Then the number of intersections between the graph of the function $y=f(x)$ and the $x$-axis in the interval $[0,6]$ is $\qquad$ .
2.7.

When $0 \leqslant x<2$, let $f(x)=x^{3}-x=0$, we get $x=0$ or 1.
According to the properties of periodic functions, given that the smallest period of $f(x)$ is 2, we know that $y=f(x)$ has six zeros in the interval $[0,6)$.

Also, $f(6)=f(3 \times 2)=f(0)=0$, so $f(x)$ has 7 intersection points with the $x$-axis in the interval $[0,6]$.