Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

What is the difference between &> and >& in bash?

tldp did not mention the latter one. Is it really a redirection operator?

Or does someone know a more complete tutorial?

share|improve this question
up vote 30 down vote accepted

From the bash man page:

There  are  two  formats  for  redirecting standard output and standard
   error:

          &>word
   and
          >&word

   Of the two forms, the first is preferred.  This is semantically equiva-
   lent to

          >word 2>&1

Read the redirection section of the bash man page.

share|improve this answer

In bash, >&word and &>word (preferred syntax) redirects standard output and standard error to the same place. This is equivalent to >word 2>&1. Look it up in the bash manual.

share|improve this answer

man bash says

There  are  two  formats  for  redirecting standard output and standard error:

       &>word
and
       >&word

Of the two forms, the first is preferred.  This is semantically equiva-
lent to

       >word 2>&1
share|improve this answer
    
Works in sh too. – Mausy5043 Apr 24 at 10:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .