A family of copulas, called semilinear, is constructed starting with some assumptions about the linearity of the copulas along some segments of the unit square. This family contains some other known families of copulas (e.g., Cuadras--Augé, Fréchet) and has a nice statistical interpretation. Several construction methods are provided, especially concerning aggregation of semilinear copulas, and a special form of ordinal sum construction is introduced. Some results about related families of quasi-copulas and semi-copulas are hence given.