Home / Labs / Writing to Files
Writing to Files
Quick answer: echo 'text' > file writes text to a file and replaces what was there. echo 'text' >> file adds it to the end instead.
Send command output into files. Write once, then append, then read it back.
Commands practised here
echo 'text' > fileWrites text to a file, overwriting any existing content.echo 'text' >> fileAppends text to the end of a file.cat <file>Displays the contents of a file.
Nearby labs
- All labsBrowse the full list.
- Exam prepWhich exams these objectives map to.
- Reading Files
- Searching a Whole Tree