the map is the territory

Now Where Could My Pipe Be?

A sigil similar to >> is the powerful |, also called a pipe. Pipes let you direct the output of one command as an input of another. Said another way, they let you invoke multiple spirits, each transforming the stream of energy as it is offered to them.

For example, let’s invoke the spirits of history.

history

description
will show you a history of your bash commands in order
gives
history with the number of the command so you can call it again.

Let’s say we wanted to see every word we’ve echoed during this session.
Type:
$: history.

You will see a long list of commands, including something like:
57 echo "the internet is animist" >> blessing
58 cat blessing
59 mkdir .spells
60 ls
61 ls -a
62 ls -a ~
63 uname -a

History lists every command we’ve entered this session, including our echo commands. Now we could scroll through this list, mentally noting our echo commands, but this would be arduous and doesn’t match our intent.

Instead, we can give this list to the spirit grep.

grep

description
Hunts down a pattern in a stream of text, returning matches
gives
a stream of text for all lines that have that pattern
boost
-i to ignore case -A{n} to include n lines AFTER the match (e.g. -A4 will include the matching line plus the 4 lines after)

Using our pipe, we can invoke history and then pass its offering to our invocation of grep and get exactly what we wanted.

in your terminal, type:
$: history | grep echo

Now you’ll see:
18 echo "hardcoooooooore"
48 echo "the internet is animist" >> blessing
50 echo "you are very cool" >> blessing

With pipes you can compose increasingly complex invocations, to be more expressive in this adopted bash tongue.

And, as we’ll see next, the stream of energy we pass through these pipes does not need to come from just your computer. You can pull information from across the world into your invocations too.