Redirecting stderr

    Source: https://askubuntu.com/questions/625224/how-to-redirect-stderr-to-a-file

    Redirect both stdout and stderr πŸ”—

    NB: Only supported in some shells including bash

    command &> out.txt
    

    Redirect stderr to stdout πŸ”—

    command >out 2>&1
    

    Redirect stderr to separate file πŸ”—

    command > out.txt 2>error.txt