That's the way you do it!

ls -l > myfile.out