Is there a difference between using && and ; in Linux commands?

I’ve been experimenting with combining command on one line. I’ve found && and ; give the same results. Are these interchangeable or is is there some subtle difference between the two?

Posted by Steve in Linux Users Group.

1 Like

There is a BIG difference between the two. If you use && and if the first command doesn’t run successfully, the second command won’t run.

With ; there is no such thing. The second command will run irrespective whether the previous command succeeded or not.


Very good tp know the difference between && and ;
Thank you



I drew an infographic explaining that.
Usually, I share the link only if you register on my mailing list. But for members, here is a direct link to download the PDF

If you want to share that with your friends, please point them to – or ask them to register on :smiley: