Chapter 8 A Crash Course in Bash




Download 7,3 Mb.
Pdf ko'rish
bet85/115
Sana27.11.2023
Hajmi7,3 Mb.
#106243
1   ...   81   82   83   84   85   86   87   88   ...   115
Bog'liq
linuxbasicsforhackers

82
Chapter 8
A Crash Course in Bash
shell is an interface between the user and the operating system that enables 
you to manipulate files and run commands, utilities, programs, and much 
more. The advantage of a shell is that you perform these tasks immediately 
from the computer and not through an abstraction, like a GUI, which allows 
you to customize your task to your needs. A number of different shells are 
available for Linux, including the Korn shell, the Z shell, the C shell, and 
the Bourne-again shell, more widely known as bash.
Because the bash shell is available on nearly all Linux and UNIX distri-
butions (including macOS and Kali), we’ll be using the bash shell, exclusively.
The bash shell can run any system commands, utilities, or applications 
your usual command line can run, but it also includes some of its own built-
in commands. Table 8-1 later in the chapter gives you a reference to some 
useful commands that reside within the bash shell.
In earlier chapters, you used the 
cd

pwd

set
, and 
umask
commands. In 
this section, you will be using two more commands: the 
echo
command, first 
used in Chapter 7, which displays messages to the screen, and the 
read
com-
mand, which reads in data and stores it somewhere else. Just learning these 
two commands alone will enable you to build a simple but powerful tool.
You’ll need a text editor to create shell scripts. A text editor is a pro-
gram that can edit plain, unformatted text, like Notepad in Windows or 
TextEdit in macOS. You can use whichever Linux text editor you like best. 
Popular hacker choices include vi, vim, emacs, gedit, kate, and so on. I’ll be 
using Leafpad in this book, as I have in previous chapters. Using a different 
editor should not make any difference in your script or its functionality.

Download 7,3 Mb.
1   ...   81   82   83   84   85   86   87   88   ...   115




Download 7,3 Mb.
Pdf ko'rish