Lessons
07Connect commands
0 of 7 tasks

Lesson 07 · about 14 min · 7 tasks

Connect commands

Chain small commands into pipelines that answer real questions.

step 1 of 7

Save what a command prints

You’ve used > with echo. It works with any command: whatever would have appeared on screen goes into the file instead.

$ ls data > data/contents.txt

Now data/contents.txt holds the list of files. Commands that print things to the screen can always save them like this.

Your turn, in the terminal

  • Save the list of files in data into data/contents.txt
mapfolders appear as you explore
/ …
home/ …
you/◂ you are here
nowSave the list of files in data into data/contents.txt
terminal
Practice terminal. Nothing you do here touches your real computer.
Type help to see what it understands.
you@terminal-mastery:~$