You can use redirection operators to redirect all output to file in Linux Bash Shell.
1 2 3 4 5 6 7 8 9 10 |
## Redirect a command output to file ## $command > file 2>&1 ps -aux > output.txt 2>&1 ## > file redirects stdout to file ## 1> file redirects stdout to file ## 2> file redirects stderr to file ## &> file redirects stdout and stderr to file ## Use > to overwrite and >> to append |