书评:Linux 命令行
我以前不喜欢评论书籍,因为作者总是希望他们的作品得到五星评价。作为一名书籍作者,我理解这种情绪。然而,我确实认为,诚实是最好的政策,在发表负面意见时不要好斗或居高临下。话虽如此,威廉·肖茨 (William Shotts) 的《Linux 命令行:完整介绍,第 2 版》由 No Starch Press 出版,做得非常出色。这是一本好书。事实上,这是一本非常好的书。
我想,看到第一段话,你就可以停下来,去买一本了,但这样你就会错过我一路上的精彩对话和机智。你肯定不想错过这些。
这本书只有 458 页,并不是书架上最大的书。按照技术领域的标准,这是一本相当精简的书。不过,别误会我的意思;没有人会从头到尾读完这本书。好吧,我想如果你在隔离期间被困在家里很无聊,你可以从头到尾读一遍。我更喜欢用它作为参考。如果我遇到无法解决的问题或疑问,我会翻阅索引,找到我需要的内容。是的,我知道互联网,但手里拿着这本书,我就不必在几十个糟糕的结果和死胡同链接中摸索了。
作者:威廉·肖茨
价格:39.99 美元/亚马逊 26.30 美元
篇幅:458 页
评分:4.5 星,123 条评论(亚马逊)
第一部分:学习 Shell
本部分涵盖文件系统导航、文件、目录、命令、重定向、权限、进程和键盘快捷键。前 100 页是新系统管理员需要花时间学习和复习的地方。在这里,您将学习如何与 Linux 交互并了解它。本节从机械角度描述了如何处理系统管理员所做的大部分工作。换句话说,这是您的日常工作。学习它。
第二部分:配置和环境
Shotts walks you through exploring your environment, which includes environment variables, startup scripts, and editing those files and variables. Also included here is a so-called gentle introduction to the vi editor. The vi editor is historically the editor on *nix systems. You should learn it to gain credibility in *nix circles. Any sysadmin worth their salary knows vi. Sure, you can venture out to others such as emacs or various graphical editors, but vi is or should be, your "Go To" command-line editor. Finally, the author teaches you how to customize your shell prompt. You can get pretty fancy, and some people love to create cool shell prompts. Personally, I stick with the default one.
PART III: Common Tasks and Essential Tools
This section of the book is for you when you're ready to tackle more advanced topics such as storage, networking, backups, package management, regular expressions (ugh), text processing, printing (haha), and compiling programs. These are the things that intermediate and senior-level sysadmins know. You need to know this material before your career can advance beyond junior-level or novice. This material is where interview questions are found. Know this material before you seriously call yourself a Linux administrator.
PART IV: Writing Shell Scripts
The author dedicated more than 100 pages to this section and deservedly so. Shell scripting is what separates wannabe Linux administrators from real Linux administrators. It's no longer about knowing some trivia or typing commands at a prompt, but now it's about making the system work for you. Shell scripting is an advanced skill that you need to acquire, and that's why Shotts used so many pages for it.
Scripting helps automate mundane tasks. Unless you love manually performing every task on your system, you'll need to learn shell scripting. The tasks that can be automated, should be automated. Be sure to document your scripts so that you remember what they're for and also so that you don't remove them during housekeeping events.
Rating
My overall rating for this book is a solid 4.5 out of 5 stars. The book has the appropriate depth and breadth to get a new administrator up and running without a lot of "in the weeds" discussion. This book is all about practical knowledge because it's written by a practicing system administrator, which is vital in learning the essentials. A book written by a practicing professional is much better than those written by a novice or someone who just thought writing a book was a good idea.
Shotts knows his stuff, and he also knows how to teach it to others. I'm very happy with this book as a reference. I mostly use it for PART IV: Writing Shell Scripts. For some reason, there are bits about loops and variables that I can just never remember. My recommendation is to buy the book. I purchased both the electronic and the paperback versions of it.
Wrap up
Linux system administration is not something you can learn on your own. Either you need a teacher, or you need a good book. This is that book. I've been a Linux sysadmin for more than 20 years, and I keep it at my desk. I also kept the first edition at my desk before this one was published. Before that, I had the classic O'Reilly Essential System Administration book by AEleen Frisch.
Trust me when I tell you that keeping your favorite books at your side is not a sign of weakness but of strength. No one knows everything, although some believe that they do. For me, The Linux Command Line is my constant companion because I know my limitations and am not afraid to look up something I don't know.
[ Want to learn more about shell scripting? Check out this free download: A sysadmin's guide to Bash scripting. ]