How to redirect std out and std err to same file

Hi

I want both standard output and standard error of my command cmd to go to the same file log.txt. please let me know the best commandline to do this.

Thanks

cmd >log.txt 2>&1

Thanks. That works great!