When I do strace echo hello, I see it is using /bin/echo, but built-in echo should be found first. Is it a functionality of strace to skip built-in commands? strace -- version 4.5.19

I understand that strace won't work on built-in commands the way it works on system executables.


Because strace isn't a shell, strace uses exec.

| improve this answer | |
  • Wow, I feel dumb. OK I was thinking about it the wrong way. You are correct, I will accept the answer when the time period passes. – Gregg Leventhal Jul 10 '13 at 13:34

When you type a command to the shell (e.g., echo hello world), the shell interprets that command and will check to see if a shell built-in command can be used before looking for a separate executable.

When you use strace, you are asking it to locate an executable and run it on your behalf. Unlike the shell, strace has no built-in commands of its own.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.