terminal.cab
No.
27
Date
Learning goal
Terminal Start, lesson 11
Level
2 of 3

Command of the day No. 27: > against >>

Purpose: Writes output into a file: replace or append.

Syntax: command > file, command >> file

Example:

echo first > list.txt
echo second >> list.txt
cat list.txt
first
second
echo new > list.txt
cat list.txt
new

Output from the simulator, as on a real Linux.

Options:

Try it in the terminal Share image

Fills in the command. Nothing runs until you press Enter.

Command of the day No. 27: > against >>. Purpose: Writes output into a file: replace or append. Example: echo first > list.txt; echo second >> list.txt; cat list.txt; echo new > list.txt; cat list.txt. Caution: > empties the file before the command even runs, so the old content is gone. Check first: ls file shows whether the name is taken; then think of >>. Remember: One > replaces, two >> append.
The same card as an image, 1080 x 1350 pixels.

Today's card ยท All cards so far