Timeline for What is the difference between a builtin command and one that is not?
Current License: CC BY-SA 3.0
        8 events
    
    | when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Apr 17, 2011 at 5:33 | history | edited | Caleb | CC BY-SA 3.0 | 
                
                    added 127 characters in body 
                
             | 
| Apr 16, 2011 at 23:01 | comment | added | user unknown | I can't upvote this, until whichis replaced bytype. I used which, over and over again, not knowing oftypeand was very astonished to lern, thatwhichis only right, if deciding between programs. | |
| Apr 16, 2011 at 21:59 | comment | added | Peter.O | type whichwhich is /usr/bin/which ..which whichwhich is hashed (/usr/bin/which)` ..type typetype is a shell builtin ..  I'm not sure what that last one means, but it looks interesting :) ..which typereturned nothing.. | |
| Apr 16, 2011 at 19:35 | comment | added | Random832 | Many systems ship with an alias of whichtotypeor some set of options e.g.alias which='type -path'- this could be the source of confusion. | |
| Apr 16, 2011 at 17:34 | comment | added | cjm | whichis not necessarily a built-in command, and if it's not, it won't know about the shell's built-ins.  POSIX requires thattypebe a built-in command, so it always knows about built-ins. | |
| Apr 16, 2011 at 16:53 | comment | added | Caleb | "System procses" just means it is being started up as an independent application managed by the kernel. The alternative in the case of builtins is just running a sub-function in the already running code of your shell. In the example you give, typeis the better indicator of what is being run, but you noticeechois both a builtin and there is an application with that name. If your shell didn't have a builtin the system one would get run. | |
| Apr 16, 2011 at 16:44 | comment | added | Peter.O | @Caleb: thanks for your comment, but it leaves me wondering about what exactly a "system process" is.. I keep seeing references to then but I don't understand whwere the distinction lies.... (btw I can't see how 'which' is an absolute indicator).. eg..'which echo =>"/bin/echo" and type echo=>"echo is a shell builtin", but 'which dd=>"/bin/dd" andtype dd=>"dd is /bin/dd" ...  so, I'm part way there .... | |
| Apr 16, 2011 at 16:02 | history | answered | Caleb | CC BY-SA 3.0 |