Live data from Hacker News

The Magic of strace

chadfowler.com

101–105 of 105 posts

Re: The Magic of strace

#101
Quick strace command that I use all the time to see what files a process is opening:

    strace -f  2>&1 | grep ^open
Really useful to see what config files something is reading (and the order) or to see what PHP (or similar) files are being included.

There's normally other ways to do this (eg using a debugger) but sending strace's stderr to stdout and piping through grep is useful in so many cases it's become a command I use every day or 2.

Re: The Magic of strace

#102

Quick strace command that I use all the time to see what files a process is opening: strace -f 2>&1 | grep ^open Really useful to see what config files something is reading (and the order) or to see what PHP (or similar) files are being included. There's normally other ways to do this (eg using a debugger) but sending strace's stderr to stdout and piping through grep is useful in so many cases it's become a command I…

Hey, that's really useful! Cheers :)

Re: The Magic of strace

#104
post #13

Earlier quoted context omitted.

My local CentOS 6.2 VM has bash-builtins in section 1, which is where "man read" takes me. Same with a RHEL 6.4 machine in the colo. This might be a distro-specific thing.

Same with OSX: "man read" opens the builtin(1) manpage. However on Debian 7.3, it opens read(2).

You can configure the priority of the sections in /etc/man.conf or similar.
Post reply on HN