I'm interested in understand the classification of finite groups of order less then 10. We have of course that for the Lagrange Theorem all groups of prime order such as $2,3,5,7$ are cyclic and therefore isomorphic to $\mathbb Z_2, \mathbb Z_3, \mathbb Z_5,\mathbb Z_7$. Then we have groups that have order $p^2$ such as $4$ and $9$ which have to be abelian and therefore isomorphic to $\mathbb Z_4, \mathbb Z_2 \times\mathbb Z_2$ and $\mathbb Z_9, \mathbb Z_3 \times\mathbb Z_3$. Now we have order 6 and 8. I'd like to make more precise the following statement: every group of this kind is a direct or semidirect product of $\mathbb Z_2$ with a normal subgroup, i.e.
order 6: can be if abelian $\mathbb Z_3 \times \mathbb Z_2 $ or if not abelian can only be $\mathbb Z_3 \rtimes \mathbb Z_2$
order 8: can be if abelian $\mathbb Z_8$ if has an element of order 8, $\mathbb Z_4 \times \mathbb Z_2 $ if doesn't have an element of order 8 but has one of order 4, $\mathbb Z_2 \times \mathbb Z_2 \times \mathbb Z_2 $ if it has only elements of order 2. If it is not abelian can be only or if not abelian can only be $\mathbb Z_4 \rtimes \mathbb Z_2 $ if has one element of order 4, $\mathbb Z_2 \times \mathbb Z_2 \rtimes \mathbb Z_2 $.
Is this true? How can I be more precise showing the automorphism of the semidirect product? How can I effectively demonstrate the part relatively of the order 8 groups? Is this way of proceeding generalizable?
Thank you in advance