This question often pops up in the Linux community, even among experienced Linux professionals. The answer is a counter-question: How else would you communicate with the core of Linux?
To elaborate on this, remember that in Linux everything is a file and the text mode of the operating system is central. So you often need to work on the command line instead of the graphical mode, just to be efficient.
I know of several Linux professionals who are not “fluent in Bash”, although it is the core scripting language to change configuration scripts and to work with automation on the command line.
The reason is that they are primarily working “one layer above”, handling application-centric tasks that do not require Bash scripting skills. Otherwise put, they do not need to change core configuration files on Linux and so their contact with the Linux command line is limited. This is also the underlying purpose of this introduction course. We will focus more on working with files and data than configuration files and networks.
So what is the Bourne again shell, Bash?
Bash is a command-line interface. With it, you can give commands to Linux.
Command-line interfaces enable you as a user to give detailed commands that the interface, the shell, can execute. Bash is therefore a command interpreter. That is exactly what it does – it interprets commands.
A shell provides you with an interface, in this case, a prompt where you can type text. This is also known as the console where the interaction is limited to displaying characters. The commands that you issue can be executable files (programs) or built-in commands. The latter are commands that are built into Bash.
With a shell, you will do various tasks such as navigating around your file system, finding files, opening files, and performing data manipulation.
But should not a Linux professional know Bash and be able to change everything in a running Linux server, to call himself a proficient Linux professional?
Well, Linux is huge and just by looking at the number of command-line utilities, you can quickly establish that it is nearly impossible to learn everything about all commands.
To summarize, you do need a basic understanding of Bash is necessary to work on the command line. This is different, however, compared with writing scripts that are several pages long and that handle complicated logic with various cases and calling a multitude of binaries, with parsing of output and so on.
Scripting with Bash
All these Bash commands can be placed together in scripts that are run from the command line. These scripts will use control-flow operators, variables as well as commands that are chained together to control the flow of execution in the script. This is the shell’s scripting language.
Bash was programmed to take commands from you. And with shell scripts, you can create a series of commands that automate tasks.
Bash is a tool and is there to help you work with Linux, to make Linux perform tasks for you.
Should a Linux professional know Bash and be able to change everything in a running Linux server.
That is a common question that I get many by business and IT professionals alike. The truth is that there is just too much to know, to be able to have a full understanding. Chances are that you will learn how to work with the man pages to find in-depth information about commands and systemwide topics. Also, Linux commands will have help sections that you can access easily on the commandline. So to summarize you will have places to go to build on your knowledge quickly and efficiently.
Linux is huge and just by looking at the number of command-line utilities, you can quickly establish that it is nearly impossible to learn everything about all commands. Nevertheless, an intermediate understanding of Bash is necessary to work on the command line.
Check what you know!
Get started with ls
, pwd
, cd
, and chmod
You can now proceed to lesson four, your first contact with the Linux command-line.