If you've been using Linux for long at all, you've no doubt seen the word Bash thrown around in forums and articles. It sometimes seems like a synonym for the terminal, but Bash and the terminal emulator are definitely two different applications. So what is Bash exactly? In this short article, we'll explore what Bash is, what it does, and how you can start using it.
Bash Defined
The name Bash is an acronym for Bourne-Again SHell, a pun on the name Stephen Bourne, creator of one of Bash's predecessors. The first beta was released in 1989, and, as of this writing, has seen its most recent update in December 2020: version 5.1.
Bash is among the most popular of shell languages, known for its combination of powerful capabilities and user-friendly commands. That's why it's so prolific across Linux distributions.
Bash operates not only on Linux, however; it's also available on macOS and BSD, and you can use it on Windows through Windows Subsystem for Linux.
But to truly define Bash, we have to understand what a shell is.
A shell is an application that accepts input from a user and executes an action in response, typically communicating with the kernel to make that happen. In that way, it's like a "shell" around the kernel.
While shells do initiate other applications through commands, they also often have interactive features themselves.
For example, when you open a Linux terminal and press the up arrow button to retrieve the last issued command, that's a function of the Bash application. The cd command for changing directories is another very common Bash command.
In addition to being an interactive application, Bash is also a scripting language. Your Linux OS in fact uses many Bash scripts in the startup process to initiate various processes.
How Can I Use Bash?
You're using Bash anytime you use the terminal in almost any Linux system.
You can confirm that with this command, which returns the name of the shell in use:
echo $0
You should get only the word bash returned. If you do, you can see the version of Bash you're using with this command:
bash --version
Your screen should look similar to this:
Issuing single commands in the terminal, however, is only the beginning of Bash's uses.
Like those scripts your OS uses, you can learn to write Bash scripts that automate processes on your Linux PC that you often do manually. A skilled Bash scripter may have scripts automating hundreds of tasks a day!
So how can you learn Bash?
By writing scripts, either on your own or guided, such as in a Bash course.
For you gamers out there, you can also learn by playing a Bash game. One example is Bashcrawl, a text-based dungeon crawler that forces you to learn and recall Bash commands to progress in the game.
We also have articles here on Make Use Of that will train you to become a better Bash scripter. We can show you for example how to write for loops in Bash, or maybe turn your scripts into clickable apps.
Leveling up Your Linux Game
We've learned about what Bash is, its history, and how you can learn to put it to work for you.
Learning Bash is just one part, however, of getting the most out of your Linux operating system. There's a lot more you can learn to become a Linux power user.
Comments
Post a Comment