Learning the bash Shell, Third Edition, is the definitive guide to bash, the Free Software Foundation's "Bourne Again Shell." It's a freely available replacement for the UNIX Bourne shell, and is the shell of choice for users of Linux, Mac OS X, BSD, and other UNIX systems.
You'll find this guide valuable whether you're interested in bash as a user interface or for its powerful programming capabilities. This book will teach you how to use bash's advanced command-line features, such as command history, command-line editing, and command completion.
This book also introduces shell programming,a skill no UNIX or Linus user should be without. The book demonstrates what you can do with bash's programming features. You'll learn about flow control, signal handling, and command-line processing and I/O. There is also a chapter on debugging your bash programs.
Finally, Learning the bash Shell, Third Edition, shows you how to acquire, install, configure, and customize bash, and gives advice to system administrators managing bash for their user communities.
This Third Edition covers all of the features of bash Version 3.0, while still applying to Versions 1.x and 2.x. It includes a debugger for the bash shell, both as an extended example and as a useful piece of working code. Since shell scripts are a significant part of many software projects, the book also discusses how to write maintainable shell scripts. And, of course, it discusses the many features that have been introduced to bash over the years: one-dimensional arrays, parameter expansion, pattern-matching operations, new commands, and security improvements.
Unfailingly practical and packed with examples and questions for future study, Learning the bash Shell Third Edition is a valuable asset for Linux and other UNIX users. --back cover
This book is thorough but outdated. Generally speaking, bash never changes all that much or all that dramatically, but it has changed enough since 2005 to notice the difference. Nevertheless, this is an adequate guide. There’s plenty of conventions that have become deprecated, but everything in this book should still run fine. A glance down the Gentoo wiki guide (or similar alternative) is probably enough to fill you in on the main differences.
The first few chapters of this book are strong. They cover the basics thoroughly, focusing on file navigation and then text manipulation. Some pretty important stuff is inexplicably left for later, putting it in the nominally more advanced section (such as bash’s somewhat unusual arithmetical operators: -lt, -le, -gt, etc.). But in general, it covers most of what you might need to know.
Like many of these comprehensive guides however, it does get messier as it goes on. An attempt is made at covering a vast array of techniques and commands, and generally the more arcane they become, the more disconnected or crowbarred-in they feel. But that’s pretty much par for the course in a comprehensive O’Reilley book, so there’s nothing really worth complaining about.
Also, I can’t help but think this book shows its age through its frequent comparisons to Pascal. Does anyone still think about Pascal?
Cameron Newham's Learning the bash Shell is an introduction to the command-line interface most commonly encountered today in server administration and in the terminal application of personal computers running Linux and Mac OS X. As I write this, the most recent edition is the 3rd, published in 2005, which describes bash 3.0. Newham explains such things as how programs communicate with the shell, keyboard navigation commands and shell customization. While he uses some of the old standard Unix programs (e.g. grep, sort) in examples, this is not a book about how to wield the power of Unix-like systems in general. Also, shell scripting is given only a brief mention, and those wanting to write powerful scripts will have to turn to another book (like O'Reilly's Classic Shell Scripting.
I have been using bash for nearly all file management and system administration tasks since 2002, and I still learned a few things here. However, this book is sorely in need of a new edition. The 3rd edition still assumes that the typical newcomer to bash is on a multi-user UNIX system, has access to a Postscript printer from the command line and a magnetic tape drive, and has probably used another shell like tcsh. Surely, even by the 3rd edition's publication date of 2005, most people interested in bash were people who had installed Linux on their personal computers. Also, bash is now at version 4.0, and readers would benefit from a small presentation of what has changed.
This book is fantastic if you've never really programmed before and have no idea whatsoever of where to begin learning programming. An extremely rudimentary knowledge of how to use the Linux command-line is all that is required.
The book introduces programming concepts gently - using sample exercises or projects. My professional background is far removed from the IT world, although I've been using Linux (Debian, Ubuntu and Arch Linux so far) for a couple of years and even I'm amazed at how easy the material is to grasp. The authors have done a splendid job.
I’ve told myself to get a book about bash so many times in the past that my Goodread‘s Want to Read shelf was getting boringly monothematic. Last month I planned to get my hands on bash Cookbook but a comment on Amazon convinced me to dedicate my time to this title instead. To make it short, I’m not exactly enthusiast: some (just some!) parts were interesting; others (most!) were overly detailed and accompanied with complicated examples, a pain to get through.
This is a book that clearly targets beginners, people with close to no experience with Linux and the bash shell. If you work on a daily basis with the penguin, you better move along.
Ok so, let’s imagine I recently moved from Windows to Linux and I want to explore what the bash shell offers me. What do I get off these 300 pages? Well, the book is divided in 3 parts:
Very basic shell features. Basic shell scripting. Basic shell features.
The first part, which covers the first three chapters, tells you about basic commands, such as “ls� and all the arguments it swallows. Unless you have never opened the terminal before, you might want to skip these pages.
Next the authors introduce some basic shell scripting, starting from variable naming to arrays and flow control. This was, by far, the most interesting part of the whole book in my opinion, but still, the author has covered only the very basics. What I’ve found particularly annoying was the choice to list all the possible options available just to find out, later, that the book wasn’t about system programming so that they would have not been explained.
Finally, we leave the magic world of scripting and get introduced to other basic features, such as jobs: background foreground, handling signals.
Throughout the book the authors use an example that gets improved as they introduce new concepts. This gets early out of control in my opinion: it’s overly hard to follow, mainly for a beginner. A very annoying thing of this example is the fact that the authors names variables, functions and files using Alice in Wonderland: Alice, the Hatter, � for real?
Other examples are found in the book. They are short ad hoc code snippets found next to some command just explained. I’ve often ended up either using man or googling to find more.
I don’t really suggest the title, neither to those new to the bash shell, nor to those that are merely interested in scripting. This book covers a little of both, but doesn’t really give any value.
As usual, you can find more reviews on my personal blog: . Feel free to pass by and share your thoughts!
This book contains a great deal of information about the intricacies of the bash shell. I picked it up as part of my effort to master the Google Cloud Platform, and I learned some useful advanced bash skills.
I'm giving it only two stars because of how outdated the latest version already was when it was released in 2005. By then, Ubuntu and other user friendly GUI-first distros already existed, but the book still references obscure machines from the '80s. It also assumes a strange level of knowledge. For example, it constantly refers to other shells, even though someone reading this book is unlikely to have ever used something like Bourne.
Over the past 17 years, the book has grown even more outdated. The rise of cloud computing alone warrants a rewrite. If anyone has recommendation for a more updated book on bash, let me know.
I use Bash on a daily basis. I write scripts quite often. But it always somehow managed to be something I never took the time to properly "learn". I just picked it up as needed.
Eventually I hit a ceiling: I wasn't getting any better at my command line usage and my scripts were still slow to compose because I always had to look up the syntax for everything.
I've had a copy of Learning the bash Shell on my bookshelf forever (or 1998 when the Second Edition was published, whichever seems more likely).
While working on my quixotic project, "Dave's Slackware Package Blog (PkgBlog)", I finally encountered the 'bash' package. Oh my, how could I expect to write anything sensible about such big subject? But I did not fear. Quite the opposite: I was excited. I had my book and a good reason to read it. Perhaps now I could finally break through my personal ceiling and actually make some big progress with a tool I use every day!
Having a specific goal made it much more enjoyable to read through the book. It is fairly dull reading, truth be told. But the information is well structured (I've used it as a reference quite a bit, so I can say that the index and table of contents are very good) and it works well as a cover-to-cover read.
I appreciate that this is a "Learning" title, not an exhaustive reference. I often find these to be most useful. Bash's built-in help is excellent (another thing I learned from this book!), filling in more detail as needed.
I highly recommend having a terminal nearby as you read this so that you can come up with your own examples for each new topic. I did just about everything in the book (minus the "bash debugger" project near the end) and it's already paid dividends for personal projects. The only way I'll retain some of this information is through periodic use, but at least now I've had a good survey of what's possible.
I've gained all sorts of useful ways to improve my use of Bash as an interface and tons of knowledge about Bash as a programming language. I also gained a lot from the technical explanations of pipes and buffers, and the ordered list of the stages of command line processing.
The only notable feature that has been added to Bash that I actually know about is the much-improved "[[ ]]" syntax for conditional tests. Otherwise, this twenty-year-old book is still completely relevant.
Overall a pretty good resource on bash and on shell scripts. I think the first four or so chapters of the book are great and really help me understand all the syntax rules as well as give an overview of how Unix works with bash. Granted, I don't think this a great starting point for people completely new to bash. I think online tutorials are better to get started with bash because the book goes into a little too much detail. But as someone who's used bash for a while but never studied it thoroughly, it was nice to read through this book to comprehensively see what features bash has to offer.
Once the book gets into the logic of writing bash scripts (such as flow control), I found that the examples began to get really unnecessarily complicated. They are built up from previous examples in the book, and are often about trying to replicate certain bash commands like `ls -l` or 'pushd'. On the one hand I can see why this might be necessary so you can clearly understand the expected output, but I would have liked some examples about automating regular tasks. I skimmed chapter 5 - 7, only looking for relevant syntax to use. Although I found Chapter 8 (Process Handling) interesting because again it was related to how Unix works with bash.
Overall a pretty good book, but it sometimes felt a bit over-detailed. It was nice to learn some of the nuances after using bash for a while, however it might not be the best resource for beginners.
This is a great introductory material for learning the bash shell. I had been using bash for years without truly taking the time to learn its principles; now this book has given me a solid understanding of the shell, the language and its numerous quirks.
It's a bit outdated, though. Bash 4 was released almost 10 years ago, and this volume just covers up to version 3 - and even so, there are missing pieces of information. Also, the examples tend to be repetitive, and sometimes the code samples leave much to be desired, they feel hacky and unpolished.
Despite its shortcomings, this book is a very good reference on a very ugly language; it has given me the confidence to write and understand bash scripts and to do so efficiently, taking advantage of a powerful and highly customizable OS shell. I bet I'll be consulting it for years to come.
Really good book, even for bash veterans. In every chapter I learn at least one new trick, shortcut or feature that I had no idea was available in bash. Some might point out that all the info is freely available online (and what isn't these days?) but the structure and progression the book follows is really well made. Highly recommended.
A great overview of the bash Shell and language. While, of course, several OS/UNIX related items are outdated, the bash language items are still relevant, as well as much of the "How the shell works" items, especially on the conceptual side.
It was a wonderful read, I learned a ton. I finished it in 5 days. There was also a lot of stuff I didn't understand. I know that I'll get more skilled in the future.
This book is awful, for me it's really hard to read and poorly structured.
The author explains things in a very weird way and instead of explaining why X happens it shows me 3 examples, complicates stuff and redirects me to a foot note. Not ideal.
Bash agility - fluency on the Unix/Linux terminal - is a super foundational meta-programming skill that I feel like gets short shrift as we all rush towards machine learning and cryptocurrency. Yo, but the stronger your bash fu, the easier your management of remote servers and such. Like, I did this the other day and basically floated away on a rainbow chariot pulled by mighty unicorns: ```pip freeze > diff - requirements.txt``` YES, I AM POWERFUL.
Just like Friedl's book on regular expressions, another clarifying book on an important meta topic, this bash book was SUPER helpful and I wish I had had it in 2014. I literally remember sitting at my desk in Dar es Salaam, staring at OSX Terminal and watching some Coursera course on some tech topic, and marveling at the instructors' bash incantations. Wtf was he doing?
"Is there some structured way to learn about Terminal!?" I thought. I didn't even know it was a shell language called bash! I didn't know shell != bash! Lots of stuff. I WIIISH I had had this then.
Anyway, yes, you can probably pick up these same bash skills by just osmosis over long periods of time. I did - there was a lot in here I had already learned (or had sorta half-known and used anyway), and I think experienced programmers will consider it real (bashy) basic. But if I had a young lady beginning her career transition journey into tech, I would hand her this and the regex book, and the keys to Udacity, and GODSPEED YOUNG MADAM.
And now, for much meta inspiration on people's hardware, editor, and shell choices, here's
The narrative style of this book is technical. The authors move between subtopics rapidly. The text gives you information for behind-the-scenes, raw I/O shell use. Experience using a command line interface (CLI) is recommended. The introductory chapters and section on shell scripting are particularly useful.
The downside: I find it often glosses over the explanation of important concepts in favor of technical examples. Some adequate explanations with examples still leave the reader challenged to uncover the true, functional inner-workings of what is being demonstrated. It's a bit dense, and sometimes overly technical in this sense. Put simply, the examples could be simplified to express the concept with more clarity, but instead they jump the difficulty level straight to the top to save space and avoid long-windedness. It leaves you sort of staring at the page wondering what is being explained.
For instance, the text covers "pipelines" as well as "for loops," but I was not able to really understand how to use either of these (simple) tools based solely on reading this book. It took years of experience to finally figure out how to use this stuff in the context of complex application. For a discrete topic like computing, I'd expect a technical book with more abstraction. Of course, if you read this entire text and perform all of the tasks within at a full level of proficiency, you're well off to the races.
This is a great book on bash and an excellent way to get more familiar with UNIX & GNU/Linux. There are plenty of examples and the examples are explained very well: several times the authors explained key details that I'd completely missed in the examples. I am a complete newb when it comes to working with shells, but after reading this book I'm confident that I could write whole programs in bash script if I chose to. My goal is to write deployment scripts for Clojure/ClojureScript web apps and this book has easily given me everything I need and more to accomplish that. The authors also don't waste any words so the book goes along at just the right clip: enough details to describe a subject and then references to continue on with if you're interested.
Very well done. I'm going to hang on to this book: it's concise enough to be kept as a reference yet so much richer than man pages or google searches.
The book is based on a similar book by the same publisher on learning the Korn Shell. Having always preferred the older Korn Shell, there is no denying that BASH is far more common due to the rise of Linux
The author provides a full working Bash debugger that summarizes some of the advanced shell features such as eval and variable string selection.
This entire review has been hidden because of spoilers.
BASH is often the default shell on UNIX and Linux systems. It's a rich language that aids in everything from file management to data analysis to system maintenance. It's not just a shell, but a scripting language, procedural language, and probably a gateway drug to a lot more powerful languages.
I don't see this book as a beginner-level book; I read it more as an intermediate (or beginner-intermediate?) reader and found it a great overview of both the basic and some advanced concepts of BASH. Then it became a good reference book.
If you do any amount of shell scripting or systems administration, then you should have this book on your shelf.
Not a bad book, but it is really boring. With 300+ pages this goes into a lot more detail than I would expect from a book that says "in a nutshell" in its cover. It does not help that (even in its 3rd edition from 2005) it makes you feel like you are in the early 90's (or even the 80's) - the use of Unix instead of Linux in the title is a dead giveaway.
If you have the perseverance to wade through all the tables of command options and some not exciting examples you will learn a lot.
Excellent overview and tutorial of the bash shell environment with interesting exercises and sample code. The reference cards in the appendices are especially useful. This is an older book, but the basics of bash shell haven't changed much since 1998 when this book was written.
learncodethehardway is probably a more practical way to learn the basics (and is free(, but this one is a lot better for learning how to do vim and emacs and the kinds of stuff that comes up in interviews. Will definitely be using this one a lot.