Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • Many of the commands are available as built-ins and as standalone executables. echo and pwd are 2 such commands, so you're stracing the standalong counterparts and not the built-ins when you did the above tests. Commented Sep 9, 2014 at 2:17
  • @slm, thanks. I realized after I found that I could find the type of command using type -a. Commented Sep 9, 2014 at 2:21
  • @slm, so if I create a standalone for cd and do the strace, chances are that strace cd will work without stty. Is this understanding correct? Commented Sep 9, 2014 at 2:33
  • Yes, if you have an executable, then you can strace it. But aliases and functions etc. are built into Bash and cannot be straced, since you'd have to strace Bash itself to watch them. Commented Sep 9, 2014 at 2:35
  • Re-read the man page for strace. There are no system calls to trace for a builtin since it's doing everything internal to Bash. Commented Sep 9, 2014 at 2:37