Linux Command Line · 14-day planAll days
Day 4 of 14 30 mincathead & tailWriting files
Look inside files without opening an editor. Use cat, less, head, tail and wc, follow log files as they grow, write and append text with > and >>, create multi-line files with a here-document, edit with sed, and know your way around nano.
By the end of today you can
- Print and page through files with cat and less
- Show the start or end of a file with head and tail
- Count lines, words and characters with wc
- Write and append to files with > and >>, and create multi-line files
- Make quick edits with sed and know the basics of nano
What's inside
- 7 sections
- 2 diagrams and mind maps
- 6 code examples you can run
- 5-question quiz
- 1Printing a file: cat
- 2Long files: less
- 3The start and the end: head and tail
- 4Counting: wc
- 5Writing files: > and >>
- 6Quick edits: sed
- 7Editing in nano
Sign in free to read this lesson
Get the full lesson with diagrams, runnable code and the quiz. Your progress is saved across devices.
Sign in free