Missão 27T-Junction
+250 XP
Splitting Output with tee
Iniciar terminal interativo para esta missão→Sem instalação necessária • Executado no navegador
Conceito e visão geral
In plumbing, a T-pipe splits a single water stream into two paths. In Linux, the tee command does the exact same thing with text streams: it reads standard input and writes it simultaneously to both the screen (stdout) and one or more files. E.g.: cmd | tee output.log.
Furthermore, tee solves a classic Linux permissions pitfall: running sudo echo "config" > /etc/app.conf fails because redirection > is handled by your unprivileged shell before sudo executes. Piping to sudo tee -a /etc/app.conf (where -a appends) runs tee with superuser privileges, safely writing to protected system files.
Instruções da missão
1. Run
2. Append privileged configuration by running
echo "Build completed" | tee build.log to view build output while capturing it in build.log.2. Append privileged configuration by running
echo "PORT=8080" | sudo tee -a /etc/app.conf.Referência de sintaxe de comandos
| Command / Syntax | Description |
|---|---|
echo "Build completed" | tee build.log | Write stdout to screen and file simultaneously |
echo "PORT=8080" | sudo tee -a /etc/app.conf | Safely append to privileged file with sudo tee -a |
Objetivos de verificação
- ○Write build status to build.log using tee
- ○Append PORT=8080 to /etc/app.conf using sudo tee -a