Pipes and filtersCommand line · 0/4 steps

Save output to a filestep 1 of 4 · beginner

Support

The command is shown. Click it to run, or type your own.

By the end of this lesson you can
  • Redirect a command's output into a file with >
  • Sort lines numerically with sort -n
  • Connect commands into a pipeline with the pipe |
  • Recognise the cut | sort | uniq -c idiom for counting values

Before you startThe previous lesson: ls, cat, wc, and the * wildcard.

The > symbol redirects a command's output into a file instead of the screen. Let's capture the line counts.

Write the line counts of every .genes file into lengths.txt.

Watch out

> overwrites the target file without warning. Use >> instead to add to the end of an existing file. When in doubt, redirect to a new name.

workspace · terminal

Type a command, or click the suggested one. ↑/↓ recall history, Tab completes file names. New to this? Hit Explain this command to see it in plain English.

…
workspace/shared/data0 files
Booting the WebAssembly runtime…
Command line0 / 4 stepsStep 1WASM shell