You stand at the edge of the Rift β a swirling chasm where data streams collide. The rules here are different: commands donβt just run, they flow into each other. Master the pipe and you master the dungeon.
|&& (run next only if previous succeeds) and || (run next only if previous fails)> and >>2> and combined with 2>&1tee to split output to file and terminalAll of these should be in your inventory before entering the Rift:
| Syntax | What It Does |
|---|---|
cmd1 \| cmd2 |
Pipe stdout of cmd1 to stdin of cmd2 |
cmd1 && cmd2 |
Run cmd2 only if cmd1 succeeds (exit 0) |
cmd1 \|\| cmd2 |
Run cmd2 only if cmd1 fails (non-zero exit) |
cmd1 ; cmd2 |
Run cmd2 always, regardless of cmd1 exit |
cmd > file |
Redirect stdout to file (overwrite) |
cmd >> file |
Redirect stdout to file (append) |
cmd 2> err.log |
Redirect stderr to file |
cmd 2>&1 |
Redirect stderr to same destination as stdout |
cmd > out.log 2>&1 |
Redirect both stdout and stderr to file |
cmd \| tee file |
Print to terminal AND write to file |
# The Rift gate requires all four fragments
ls -F
# arena/ rift_gate key_assembler*
inventory
# stone key fragment, tome fragment, vault key fragment, portal crystal β
./key_assembler
# All fragments combined β Rift Key obtained.
cd arena
ls -F
# combatants scoreboard arena_boss*
cat combatants | sort | uniq
# Unique combatant list, sorted alphabetically
cat combatants | grep "elite" | wc -l
# Count of elite combatants
# Engage the arena boss
./arena_boss
The arena boss asks pipe-based puzzles. Answer by constructing the right pipeline.
cd ../pit
cat instructions
# "Raise the drawbridge ONLY if the watchtower lights up. Fail gracefully."
./watchtower && ./raise_drawbridge
# If watchtower succeeds: drawbridge raised.
# If watchtower fails: drawbridge untouched.
./watchtower || echo "Watchtower failed β lighting torches instead."
./pit_boss
cd ../../spire
cat spire_challenge
# "Capture all output from the oracle β both wisdom and errors β into oracle.log"
./oracle > oracle.log 2>&1
cat oracle.log
# Also capture with tee so you still see it:
./oracle 2>&1 | tee oracle.log
cd mezzanine
# Combine all techniques:
ls -la | sort -k5 -rn | head -10 > biggest_files.txt
cat biggest_files.txt
ls -a
# . .. .elevator/ .satellite/
cd .elevator
ls -F
# control_panel floor_select*
./floor_select
cd ../.satellite
ls -F
# transmitter* signal_logs satellite_boss*
cat signal_logs | grep "ERROR" | tee error_report.txt
cat error_report.txt
./satellite_boss
The satellite boss is the final encounter. It uses all skills: pipe a command through grep, redirect errors, chain with &&. Complete it to finish the dungeon.
| Problem | Cause | Fix |
|---|---|---|
| not working |
Wrong pipe character | Use \| in tables; actual \| is just | in shell |
2>&1 must come AFTER > |
Order matters | Always: > file 2>&1 not 2>&1 > file |
&& chain stops early |
A command failed | Add \|\| fallback or check exit codes |
| Hidden dirs not found | Forgot ls -a |
Always use ls -a in unfamiliar directories |
> and >>2>&1 must follow >map shows all chambers as completeContinue your terminal adventure with these resources:
The Rift closes behind you. The dungeon is conquered. Every command a spell β every pipe a portal. πβοΈβ¨