how to know the number of solutions in a linear equation (1 solution, infinite solutions or no solutions)

The first one:
[tex]-40x+40=20x-20[/tex]Solving for x:
[tex]-40x-20x=-40-20=>\text{ -60x=-60, so x=1}[/tex]The second one:
[tex]20x+40=40x+20[/tex][tex]20x-40x=20-40->\text{ -20x=-20= x=1}[/tex]The third one:
[tex]-20x+40=-20x+20[/tex][tex]-20x+20x=20-40->\text{ 0=-20}[/tex]This one don´t have
And the last one
[tex]40x+40=40x+20[/tex][tex]40x-40x=20-40=>\text{ 0=-20}[/tex]It doesn't have solution