A shell builtin is a command called from a shell, that is executed directly in the shell itself.

learn more… | top users | synonyms

19
votes
5answers
4k views

Why is echo a shell built in command?

$ which echo echo: shell built-in command. $ which ls /bin/ls $ which cat /bin/cat Why is echo not an independent utility like ls, ps, cat etc? Why is it shell specific? Any good reasons?
32
votes
4answers
3k views

What is the difference between a builtin command and one that is not?

Is there any intrinsic difference between a builtin command and another command which can nominally do the same thing? eg. Do builtins get "special" treatement? ... is there less overhead running ...
22
votes
7answers
3k views

What purpose does the colon builtin serve?

I've hacked on a lot of shell scripts, and sometimes the simplest things baffle me. Today I ran across a script that made extensive use of the : (colon) bash builtin. The documenation seems simple ...
16
votes
2answers
2k views

Can I get individual man pages for the bash builtin commands? [duplicate]

Is there anywhere you can download a manpage for every builtin commands? I know you can just use help or man bash and search to find info about it, but I want them separated, so I can just do man ...
1
vote
3answers
773 views

how does built in commands of a shell implemented in Linux? as a function or thread of shell process?

I know that external commands are run in the shell by creating a separate process. But what exactly happens when a built in command is run in a shell. Are they executed as a function or if the shell ...
9
votes
4answers
277 views

When are the built-in commands loaded to memory

Let's say if I type in cd in my shell. Is cd loaded from the memory at that moment? My intuition is that these built-in commands are pre-loaded to the system memory after the kernel has been loaded, ...
3
votes
2answers
923 views

Capture multi-line output of a bash builtin

Normally, bash is able to assign multi-line output of a command: L=`ls` This works from both interactive shell and scripts. But it appears the output of a builtin can't be captured in a variable: ...
4
votes
1answer
276 views

Why are parameters to Bash's builtin optional?

Running simply builtin prints nothing and returns exit code 0. This is in accordance with help builtin, which shows all parameters as optional. But why isn't this no-op an error? Is there a use case ...
2
votes
5answers
813 views

missing man pages of some commands

Typing man alias gives me No manual entry for alias The same thing goes for export and eval. At first I thought it only happens to shell built-in commands but man echo gives me the man page. ...