In this paper we give the dimension and an algorithm to compute a basis of all the infinitesimal deformations of Ln on the variety of (n+1)-dimensional Lie algebra laws L. Recall that every filiform Lie algebra can be obtained by a deformation of Ln[Vergne (1970) ]. In the same way as filiform Lie algebras, all filiform Lie superalgebras can be obtained by infinitesimal deformations of the model Lie superalgebra L. In this paper we will also study the infinitesimal deformations of L which lie in Hom(Ln∧Ln,Ln), giving the dimension and an algorithm to compute a basis of them. One could think that the two sets of deformations aforementioned, one for Lie algebras and another for Lie superalgebras, can be the same. But this assumption is not correct, in particular we will prove that the set of deformations for Lie superalgebras is a strict subset of the set of deformations for Lie algebras. Thus, we will give a necessary and sufficient condition for a cocycle of the Lie algebra Ln to be a cocycle of the Lie superalgebra L.