Перейти к содержанию

Saving output to files

English

Catching the output

  • Normally a command's output appears on screen. The > symbol redirects it into a file instead:
echo hello > greeting.txt
  • Nothing prints — the text went into greeting.txt. Read it back with cat greeting.txt.

echo hello > greeting.txt saves the output in a file; > replaces it and >> adds to the end

Войти или создать аккаунт

IGCSE, A-Level & AP