Peek at files with head and tailCommand line · 0/4 steps

See the top of 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
  • Show the first lines of a file with head
  • Show the last lines with tail
  • Skip a header row with tail -n +2
  • Preview a slice of data before feeding it into a pipeline

Before you startThe first lesson: ls, cat, and wc.

head prints the first lines of a file. Add -n 3 to ask for exactly three, just enough to see the columns and the first rows.

Show the first 3 lines of variants.tsv.

Tip

With no -n, head shows the first 10 lines. It's the fastest way to check a file's columns and format before you commit to processing it.

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