This paper addresses the time-varying formation-containment (FC) problem for general linear multi-agent systems based on an observer viewpoint under the directed communication graph which contains a spanning tree. A new format of time-varying formation shapes with the properties of translation, scalability and rotation is proposed. Then the time-varying formation tracking problem where the real leader's input is unknown to all other agents is solved independently. After that, the time-varying FC problem where the challenge is how to deal with the formation-achieving agents' unknown nonzero inputs for containment-achieving agents, is firstly addressed. All the designed controllers, which need no eigenvalue information of the whole graph, are fully distributed and so can be applied to large-scale systems. The influence of communication graph structure to the control convergence rate is further analysed. The above theoretical results are verified by multiple nonholonomic vehicles in simulations.