Project Grok

Explanations and examples for useful concepts, tools, and patterns on the command line, particularly using the bash shell, which can be used on all major operating systems.

Audience

Programmers, or (at minimum), computer "power-users". Emphasis is on Linux, but many things will work on MacOS, and can be done on Windows as well with some caveats (see universality).

For very simple operations, examples will be demonstrated without much explanation. Explanation will be offered for more complex actions.

Reasoning

In programming, problems are solved programmatically; we use syntax and language to solve problems at a higher level, removing tedium and repetition. And yet, when it comes to the operating system itself, many programmers engage with computers indirectly, using a GUI, mouse, and time-consuming ad-hoc actions. Armed with general programming knowledge, and some additional knowledge of how shells work, programmers can 'speak directly' to the operating system, telling it what they want done with much less hassle.

The acquisition of this knowledge can be time-consuming and challenging. This work aims to show many essential, beneficial, and even simply interesting and enjoyable ways to work with a shell, using a terminal, and issuing commands.

Approach

This work aims to arm the reader with a very wide set of knowledge about many powerful and interesting things that can be done on the command line. It aims to move fast, and keep knowledge clear, comprehensible, and fast-paced. It does not aim to be comprehensive, or provide deep knowledge of any given subject. For depth, the reader will have to consult external sources. In many instances, references to interesting additional information will be provided in the footnotes.

This work also makes no attempt at neutrality, it is quite opinionated, and, while covering a good amount of conceptual ground, still focuses only on topics the author considers useful and interesting. It does aim to break down complex concepts and make them as simple as possible, with clear word choices in explanations, clear examples for each concept, and so on.

Assumptions About Tooling

The guide assumes you have the following tools:

  • a relatively common distribution of Linux (e.g. Ubuntu, Fedora, etc.)
  • bash for running all shell commands

Bash can be used on any machine, and is the default shell on most machines. For being so uniquitous, everything in this work assumes the use of bash. Many concepts will still translate to other shells.

Table of Contents

  1. Shell basics
  2. Next thing