A molecular dynamics simulation of confined n-alkanes with different chain length and thickness has been performed. It discusses the film structure and shear stress of thin film at the atomic scale. Specifically, layered structure in thin film is observed due to the strong liquid-solid interaction and small confinement. An explicit two-layer lubricant film that has 'tetratic' order is observed. Without crystalline bridges, the shear stress drops dramatically. For a thin film with up to three layers, the shear stress varies with thickness. This is due to that the number of crystalline bridges varies between ordered layers. When the film thickness increases further, the effect of the interfacial interaction towards the inner film becomes blunt, and the shear stress becomes stable and is dominated by the lubricant chain length.