Skip to content

Latest commit

 

History

History
230 lines (179 loc) · 6.42 KB

books.org

File metadata and controls

230 lines (179 loc) · 6.42 KB

book.rymcg.tech

Books

Site features

Navigation

This website is presented as a book of books, so you can read everything from beginning to end. Use your keyboard left/right arrow keys to flip through the pages.

If you are using a touch screen interface, use the arrow buttons at the top right of the page.

Table of contents

The menu bar on the left contains the index of all the books, with the titles as top level headings. On smaller screens, you may need to expand this menu using the top left hamburger menu.

At the top left of every page (and just to the right of the sidebar), there is a button to show the outline of the current page.

Theme

This website uses the Zen Light/Dark theme by default, which tracks your operating system and/or browser preference for light or dark mode. You can change the desired theme in the lower left menu, below the table of contents.

Search

Use the search box in the left hand menu to search all of the books on the site.

Blocks

Shell command blocks

Throughout these books, you will find literal command blocks that you should copy and paste to run in your Bash shell.

Commands that are to be run on your primary workstation are in blue:

Each code block is intended to be run as a whole (don’t copy individual lines). Click the Copy to clipboard button on the right hand side of every code block (it only shows up when your mouse cursor is hovering over it.)

Paste the copied command block into your terminal, edit it as necessary, and then press Enter to run it.

You will also sometimes see the example output that a command prints:

Pay attention to the color and the title of the box to provide important context. Commands that are to be run on a different machine, or in a container, etc. are usually orange:

Config blocks

Temporary shell variables are used to carry common config values across multiple command blocks. You can copy and paste them just like you do when running a command, but they are used only for configuration before running another command:

Subsequent code blocks can reference these temporary variables:

Edit file blocks

Sometimes it’s easiest to edit a file by hand. These green blocks invite you to edit the given file, with your preferred text editor:

Use Bash 5.1+

The commands written in this book are tested with Bash version 5.2:

Bracketed Paste

Since Bash 5.1, an important feature has been turned on by default: bracketed paste. This lets you copy and paste multi-line commands, from this web page, into your terminal, and edit the entire command directly on the command line, before anything is run. It gives you a chance to read, and edit, the entire command block that you paste, to be sure its all correct, before you run it. When you’re ready, you press the Enter key, and then the whole block is run. To cancel, press Ctrl-C.

  • When you paste a block into Bash, it is automatically highlighted in inverse color. This should indicate to you that the command has not yet been run.
  • You can edit the entire multiline code block, but you need to be careful, do not press the up or down arrow keys, because this will cancel the command and begin searching your command history instead.
  • Use the linear left/right movement keys for readline mode:
    • Left / Right arrow keys to move the cursor one character at a time.
    • Ctrl + Left/Right arrow keys, move by words at a time.
    • Ctrl-A moves the cursor to the very beginning of the block.
    • Ctrl-E moves the cursor to the very end of the block.
    • Ctrl-K will “kill” the text after the cursor.
    • To cancel the command before running it, press Ctrl-C.
    • To run the reviewed command, press Enter.

Before Bash 5.1, unless you specifically turned this feature on, commands that you paste would be run /immediately/, which is such an insecure anti-feature for a default setting!

Footnotes