[mdlug] Difference between ; and &&

James Hice jameshice at gmail.com
Wed May 9 08:29:21 EDT 2012


For ;  each command is executed
For && the second command is only executed if the first returns true
On May 9, 2012 8:12 AM, "Mat Enders" <mat.enders at gmail.com> wrote:

> Hello all,
>
> When stringing commands together at the command line I always use the
> semicolon ;  I however see && used frequently and was wondering what
> the difference was.
>
> For example what is the difference between these commands:
>
> apt-get update;apt-get dist-upgrade
> and
> apt-get update && apt-get dist-upgrade
>
> --
> Mathew E. Enders
>
> "Where once Samba and Apache sold Linux to the world they are now just
> part of the plumbing.  But that's OK, plumbers make good money."
> --Jeremy Allison
> _______________________________________________
> mdlug mailing list
> mdlug at mdlug.org
> http://mdlug.org/mailman/listinfo/mdlug
>



More information about the mdlug mailing list