Skip to content
zero2vibecodelearn vibe coding

What echo > file does

echo hello > file.txt: Write text into a file, replacing whatever was in it.

The echo command page covers what it does in general, with an example.

echohello>file.txt
  • echo— command — print text
  • hello— argument: a file, a folder, or text
  • >— write the output to a file (overwriting it)
  • file.txt— argument: a file, a folder, or text

What it does when you run it

$ echo hello > file.txt
$ cat file.txt
hello

Run it yourself

The same files. Nothing here can break, and nothing leaves your browser.

Explain other commands

Written by Mikhail Kuzmitskii