strace -f -p pid_no > trace.txt 2>&1
I was given the above command to trace one of the java processes which was failing with an outofmemory exception.
Based on man I under stand what -f and -p stand for. I also understand redirect output to trace.txt. But I am not clear on what '2>&1' is for. This has successfully run and helped me debug some issues. Can somebody explain what is the significance of '2>&1' is? Thanks |
2 is stderr, 1 is stdout
you are effectively saying send/redirect stderr (2) to the same location as stdout (1) All About Redirection you might also be interested in the use of strace's output to a file option... Code:
strace -f -p pid_no -o trace.txt :study: |
Thanks for helping understand redirection. Also the second command is easier to remember :)
|
All times are GMT -5. The time now is 12:50 AM. |