A book about the command line for humans.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

77 lines
3.1 KiB

  1. userland: a book about the command line for humans
  2. ===================================================
  3. This is the source for some text which can be found here:
  4. [p1k3.com/userland-book/](https://p1k3.com/userland-book)
  5. ...which is probably the best place to read it.
  6. what
  7. ----
  8. From the introduction:
  9. > Late last year, [a side trip](//p1k3.com/2013/8/4) into text utilities got me
  10. > thinking about how much my writing habits depend on the Linux command line.
  11. > This struck me as a good hook for talking about the tools I use every day
  12. > with an audience of mixed technical background.
  13. >
  14. > So now I'm writing a (short, haphazard) book. This isn't a book about system
  15. > administration, or writing big software systems, or becoming a wizard. I am
  16. > not a wizard, and I don't subscribe to the idea that wizardry is a requirement
  17. > for using these tools. In fact I barely know what I'm doing most of the time,
  18. > but I still get some stuff done.
  19. >
  20. > My hope herein is to convey something useful to people who use computers every
  21. > day, but for whom the command line environment seems mystifying, obscure, or
  22. > generally uninviting. I intend to gloss over many complexities in favor of
  23. > demonstrating a rough-and-ready toolset.
  24. [code.p1k3.com/gitea/brennen/userland-book](https://code.p1k3.com/gitea/brennen/userland-book)
  25. is the canonical git repo, for the moment. There's also a [GitHub
  26. mirror](https://github.com/brennen/userland-book).
  27. how
  28. ---
  29. This is mostly just some Markdown files and a handful of scripts. Chapters are
  30. listed in a file called `chapters`; each chapter is a directory containing an
  31. `index.md` and any supplemental files. These are pushed through `render.pl`
  32. and concatenated with `header.html` & `footer.html`. For convenience, this is
  33. handled by a basic `Makefile`:
  34. $ make
  35. cat chapters | xargs ./render.pl | cat header.html - footer.html > index.html
  36. `render.pl` wraps up a library called `Text::Markdown::Discount`, which in turn
  37. wraps up the Discount Markdown parser. Aside from this, it also generates a
  38. table of contents and expands code of the form
  39. <!-- exec -->
  40. $ [some command]
  41. <!-- end -->
  42. to include the output of the command executed in the directory containing the
  43. rendered file, which is how most of the example commands in the text are
  44. rendered. In keeping with long tradition, this is done with cheeseball regex
  45. substitution. **Be aware that, by running make, you are implicitly trusting
  46. most of the commands found in the text to run on your system.** This is no
  47. weirder than the level of trust extended to most any build process, but I don't
  48. want it to catch anyone by surprise.
  49. There's also a `links.md`, which should contain all links to external
  50. resources.
  51. To build the whole thing without errors, you'd need to be on a system with a
  52. couple of external repos, Bash and the GNU coreutils, and miscellaneous
  53. utilities (notably `cowsay`, `dict`, `figlet`, `aspell`, `curl`, `lynx`, and
  54. `w3m`). A recent Debian or some derivative would probably work best. One of
  55. these days I'll wrap up all the dependencies in a package.
  56. author
  57. ------
  58. Brennen Bearnes (p1k3.com)