Saving output to files
עמוד זה דורש דפדפן עדכני (תומך ב-SharedArrayBuffer). אנא עדכן את Chrome, Edge, Firefox או Safari לגרסה העדכנית ביותר.
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 withcat greeting.txt.

English
Replace vs add
>replaces the file's contents (or creates it if new).>>appends — it adds to the end, keeping what was there:
echo line one > notes.txt
echo line two >> notes.txt
- Use
>>when you are building up a file, like a log.
English
Why this matters
- Saving output lets you keep results, build files from commands, and feed one program's output to another.
- ⚠️ Watch out:
>on an existing file erases it first. Use>>when you mean "add".
English
Common mistakes
>overwrites a file;>>adds to the end.>on a file that already exists erases it first.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Send the output of echo into a file with >. Write hello תוך greeting.txt, then cat it back.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
>> adds a line instead of replacing. Write first תוך log.txt, then append second, then show the file.
רמת קושי 2/5 · 140 מטבעות + בונוס קטן בהשלמה הראשונה היום
Save the names in names.txt in alphabetical order into a new file sorted.txt, then show sorted.txt.