Readit News logoReadit News
Posted by u/petr25102018 7 months ago
Show HN: I wrote a modern Command Line Handbookcommandline.stribny.name/...
TLDR: I wrote a handbook for the Linux command line. 120 pages in PDF. Updated for 2025. Pay what you want.

A few years back I wrote an ebook about the Linux command line. Instead of focusing on a specific shell, paraphrasing manual pages, or providing long repetitive explanations, the idea was to create a modern guide that would help readers to understand the command line in the practical sense, cover the most common things people use the command line for, and do so without wasting the readers' time.

The book contains material on terminals, shells (compatible with both Bash and Zsh), configuration, command line programs for typical use cases, shell scripting, and many tips and tricks to make working on the command line more convenient. I still consider it "an introduction" and it is not necessarily a book for the HN crowd that lives in the terminal, but I believe that the book will easily cover 80 % of the things most people want or need to do in the terminal.

I made a couple of updates to the book over the years and just finished a significant one for 2025. The book is not perfect. I still see a lot of room for improvement, but I think it is good enough and I truly want to share it with everyone. Hence, pay what you want.

EXAMPLE PAGES: https://drive.google.com/file/d/1PkUcLv83Ib6nKYF88n3OBqeeVff...

https://commandline.stribny.name/

mtlynch · 7 months ago
Cool book!

Humble suggestion: Give more specific examples of what the reader will learn on the landing page. From the landing page, I don't know if this is for total command line beginners or has helpful tips for people familiar with bash already. I had to hunt around to find sample pages, and they provided much better sense of what's in the book.

Also, spotted some small issues in the copy:

"Fresh out of press" - The more common expression is "hot off the press." "Out of press" sounds similar to "out of print" (i.e., no longer sold)

"Grok the Linux command line on only 120 pages" - should be "in only 120 pages"

petr25102018 · 7 months ago
True, the landing page could be more detailed. I didn't want to repeat much the info on Gumroad page, but maybe I should rethink it.

And thanks for the copy suggestions. I am not a native speaker :)

rubit_xxx17 · 7 months ago
I’m excited about this book and appreciate your work!

One thing that was distracting was the large title font when I tried to view this site in portrait mode on mobile, as some of the letters are cut off. If that could be fixed, it would help ensure people stay engaged and read it.

You could also potentially use an LLM or something like Grammarly to help proofread it (not edit it).

This is very cool!

frosting1337 · 7 months ago
I definitely think you should add more info to the landing page - I had no idea there was further information on the Gumroad page.
charlie-83 · 7 months ago
Cool, couple of comments. The website it a bit broken on mobile (at least for me) since text goes off the screen. Second, it would be good to have some sample pages or at least a page of contents so people can see the level of detail the book is aimed at. I know I could just get the book for free and then pay later but that kind of a faff and I feel bad choosing $0 for these kinds of things.
petr25102018 · 7 months ago
Thanks for the feedback. I was trying to make it work on mobile but maybe I didn't test it well in the end.

As for a sample, I will go and try to make something now. Thanks.

Edit: Example pages here: https://drive.google.com/file/d/1PkUcLv83Ib6nKYF88n3OBqeeVff...

PeterWhittaker · 7 months ago
One nit: ^D only exits if the cursor is at the beginning of a line. Enter <space>^D and the session remains.

Otherwise, looks good! Use of "env" and proper quoting are strong signals!

danadam · 7 months ago
page 112

> if [[ "${1-}" =~ ^-*h(elp)?$ ]]; then

> ... is an option that starts with one or multiple - characters ...

"one or multiple" is + not *. The regex above will also match "h" and "help" without - character(s).

pipes · 7 months ago
I agree with all this. I'm on Firefox android, pixel, lose part of the screen too.

I'd love to read a table of contents. I don't want to rip you off with zero dollars!

Anyway, sounds like a great book. Congratulations on completing and "shipping"!

petr25102018 · 7 months ago
> I agree with all this. I'm on Firefox android, pixel, lose part of the screen too.

Ah okay, I really wasn't aware. Thanks for reporting.

jaredhallen · 7 months ago
I am also seeing text off the screen using Brave on Android.
petr25102018 · 7 months ago
You are right. It is wrong, will need to look into this.
petr25102018 · 7 months ago
justusthane · 7 months ago
I consider myself reasonably proficient in the shell, but I learned something just from your sample pages (process substitution). Purchased!
petr25102018 · 7 months ago
Thanks!
teddyh · 7 months ago
If you have not skimmed through the manual of bash¹ enough to learn about process substitutions, what makes you think you would read a book?

1. <https://www.gnu.org/software/bash/manual/bash.html>

SlackingOff123 · 7 months ago
Page 12 of the example pdf ends with "On Linux, the PATH looks something like this:", but then there's no PATH example shown.
petr25102018 · 7 months ago
Yes, the linked sample pages are just randomly taken pages from the book PDF, as I put it together quickly for the Show HN. Apologies. I will make a better example when I rework the landing page.
pie_flavor · 7 months ago
Page 13 isn't in the example pdf. It's a bunch of scattered pages to give you a feel for the whole thing.
jcynix · 7 months ago
Hmm, the example page doesn't convince me, for example

> The diff utility can compare files and print their differences. If we pass it the result of ls commands, we can compare the contents of directories.

No, if you pass the output of ls commands, you might get an error because you'll pass a bunch of files to diff.

And last but not least there's

    diff -r directory-a directory-b
to compare two directories file by file.

sureglymop · 7 months ago
I think it was about demonstrating process substitution. You don't pass a bunch of files to diff, you pass the output of ls, as a file, to diff.

I actually thought it was awesome to see that. I use this a lot to diff the output of commands and many people don't know about it.

petr25102018 · 7 months ago
I wanted to demonstrate the use of the substitution, not the best way to diff directories. Often I tried to create examples that demonstrate multiple concepts or tools at once to save space. But I see your point.
flas9sd · 7 months ago
if you add a cover page with http link, an example download read at a later time will find its way back more easily. Looks good!
petr25102018 · 7 months ago
Thanks for the suggestions:)
swhite237 · 7 months ago
Any resources or suggestions for how to find projects or exercises for each section?

I need to train some people (who will never use the command line and will go back to excel and VSCode, but I am not the genius who decides what people have to be competent in…) and this book is great, but I don’t think they are motivated enough to learn without some projects or problems and I struggle to invent nonsense projects.

briandoll · 7 months ago
Folks interested in this will also appreciate The Shell Haters Handbook: https://shellhaters.org/deck/
MaggieL · 7 months ago
Also don't miss https://wizardzines.com/
dkarl · 7 months ago
Is your focus on older tools that tend to be on most machines and used in older shell scripts (e.g., find and grep), or on newer and upgraded tools (fd, fzf, rg) that developers install on their own machines, or both?
petr25102018 · 7 months ago
The older standard tools, because they can be easily put in CI pipelines and shared as scripts with coworkers.

For example, in my personal and professional life I use Make everywhere. The book mentions alternatives, but the examples are built on the time-tested tools.

I focused on things that don't require install (if given the option) or the ones that you are more likely to encounter at work. It is a tradeoff and I can see how the reverse would be appealing too.

cerved · 7 months ago
<3 GNU Make
nickjj · 7 months ago
How has the "pay what you want" model worked out if you don't mind me asking? It's something I've thought about in the past for selling courses.
petr25102018 · 7 months ago
I just changed the payment model before posting it here, so there is no past data on this. I don't expect it to generate revenue compared to normal sales (it will most likely be a small fraction). But for normal sales you need to be able to promote it.

My primary motivation is to share the work that I spent a lot of time on because I want to move on and work on other things (I don't want it to just sit on my disk when it can be useful to others before getting outdated etc.). It never was meant to be some primary source of income. In that case I would be writing a book about AI :)

Maybe I will write a blog post with some reflections about making the book at some point :)

ctippett · 7 months ago
I admire your mindset (and humility). Thanks for making this available.
rochak · 7 months ago
Good resource to couple this resource with: https://linuxjourney.com.
asicsp · 7 months ago
See also this open source version inspired by that site: https://github.com/daquino94/linux-path