What does the `&>` operator do in bash?

QuestionsQuestions8 SkillsProData Stream RedirectionOct, 01 2025
095

The &> operator in Bash is used for redirecting both standard output (stdout) and standard error (stderr) to a file. It combines the functionality of > (which redirects stdout) and 2> (which redirects stderr).

Example:

command &> output.txt

In this example, both the output and any error messages from command will be written to output.txt. If the file already exists, it will be overwritten.

This operator is useful for capturing all output from a command in a single file.

0 Comments

no data
Be the first to share your comment!