Given a family of graphs \(\mathcal {H},\) a graph G is \(\mathcal {H}\) -free if it does not contain any member of \(\mathcal {H}\) as a subgraph. The generalized Turán number ex \((n,T,\mathcal {H})\) of \(\mathcal {H}\) is the maximum number of copies of graph T in an n-vertex \(\mathcal {H}\) -free graph. Let F be a linear forest consisting of k paths of orders \(\ell _1,\ell _2,\ldots ,\ell _k,\) respectively. In this paper, we determine the exact value of ex \((n,K_s,\{F,K_m\})\) for sufficiently large n under some restrictions on F and s, and characterize the corresponding extremal graphs. Our result can be regarded as an extension of the result of Zhu and Chen (2022), and Fang, Zhu and Chen (2025), the former determined the exact value of \(\textrm{ex}(n,K_s,F)\) for \(n=\Omega (|F|^s)\) and \(k\geqslant 2\) except some \(\ell _i=3,\) the latter determined the exact value of \(\textrm{ex}(n,K_s,\{P_\ell ,K_m\}).\)