do you want to strace an already running process? At least on Linux (with root permission), you can try the following to attach to a Bash shell prompt process.
# strace -p [PID of a process] Process 2055 attached read(0,
And it's waiting there. The option -p is the one that attaches to a running process. With the option -d, you can get strace to display debug information from itself.
See the strace (1) manual,
" -d Show some debugging output of strace itself on the standard error. "
Without root permission, you'll get similar errors, like the following on an Ubuntu 13.10:
$ strace -p [random PID] strace: attach: ptrace(PTRACE_ATTACH, ...): Operation not permitted Could not attach to process. If your uid matches the uid of the target process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf