standard output and error to same file

question:

I want both standard output and standard error of my command cmd to go to the same file log.txt

answer:

cmd >log.txt 2>&1
Advertisements