strace tmux output redirected to a file

Swair picture Swair · Sep 20, 2012 · Viewed 12k times · Source

I want to check which files does tmux touch when it is launched (not just the list of open files when tmux is running). Strace tmux seemed like the best option.

When trying to redirect the output to a file strace tmux > /tmp/blah. File is empty.

Why does this happen? How to redirect the trace to a file?

Answer

Swair picture Swair · Sep 20, 2012

Oh I got it. Strace doesn't print to stdout. It prints to stderr.

strace tmux 2> /tmp/blah works.