Periodic behavior of linear automata