Quête 27T-Junction
+250 XP
Splitting Output with tee
Lancer le terminal interactif pour cette quête→Aucune installation requise • S'exécute dans le navigateur
Concept et aperçu
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.
Instructions de la mission
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.Référence de syntaxe des commandes
| 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 |
Objectifs de vérification
- ○Write build status to build.log using tee
- ○Append PORT=8080 to /etc/app.conf using sudo tee -a