GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing linuxhandbook.com β Shell Built-in Commands List Shell Built-in CommandsIn Linux, there are shell built-in commands which you are already using but never paid attention to. Learn more about them in this tutorial. Β· By Sagar Sharma Β· 7 min read
Shell Built-in Commands
In Linux, there are commands and then there are shell built-ins. Linux purists refrain from calling them commands or shell built-in commands. So, what's so special about these shell built-ins and how are they different from other Linux commands? You'll learn about them in this tutorial. What is a shell built-in?When you run a Linux command, it is run from a binary in a sub-shell by forking the existing process. However, a shell built-in is contained in the shell itself. It runs in the same shell without creating a new process. Thus, shell built-ins are faster. cd, pwd, exit, export, alias are some of the commonly used shell built-ins. Want to know what other shell built-in commands are there, why, and how they are used? In this tutorial, I'm going to answer all such questions. List of shell builtin commandsTo list all the builtin bash commands, all you have to do is execute the ![]() A long list of commands. Isn't it? Now, let's have a look at why they are used in the first place:
π€ Some Linux purists frown upon calling them shell built-in commands. They prefer not addressing them as commands. However, most Linux books call them built-in shell commands so I see no harm in using the 'command' word with shell built-ins. No man pages and binaries for shell built-in commandsRegular or should I say external Linux commands come with a man page entry that gives information on how to use them. However, shell built-in commands don't have man pages. If you try using the man command, it will show an error like this: You'll have to use the help command that you saw above: And it will give you some hints on using the built-in command. Similarly, you won't see binaries for the shell built-ins with whereis and which commands. Identify the shell built-in commandTo identify which command is built-in, you can use the type command as shown: For example, if I want to check whether the ![]() π‘ Sometimes you'll see a re-implementation of a shell built-in as an external command. echo is a common example. To identify, use type -a to see if there is any re-implementation of a built-in command.But what if the command is not built-in? So what output can you expect from the type command? Well, apart from the above output, it can give you four other types of output:
Use Type Command in Linux to Get More Info About Commands The type command tells you whether a Linux command is built-in shell command, where is its executable located and whether it is aliased to some other command. Hereβs how to use the type command in Linux. Linux HandbookChristopher Murray![]() More bash specialsBash also has some special variables that you may want to know about next. Special Variables in Bash Shell [With Script Examples] The bash shell has some special variables that have specific usages and purposes. Learn more about them here. Linux HandbookSagar Sharma![]() Since we are discussing 'specials', how about special file permissions? What is SUID, GUID and Sticky Bit in Linux? How to Use Them? You see an s instead of x in the file permissions? Linux has some special file permissions called SUID, GUID and Sticky Bit. Know more about them. Linux HandbookAbhishek Prakash![]() I hope you liked this article on shell built-ins. Let me know if you have questions or suggestions. About the author
Sagar Sharma
A software engineer who loves to tinker with hardware till it gets crashed. While reviving my crashed system, you can find me reading literature, manga, or watering my plants.
Updated on Jan 18, 2025
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You are visitor 01402503 β GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ600. No cookies required. |