Skip to content
skillbld
Linux Command Line · 14-day planAll days
Day 4 of 14 30 min

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
  1. 1Printing a file: cat
  2. 2Long files: less
  3. 3The start and the end: head and tail
  4. 4Counting: wc
  5. 5Writing files: > and >>
  6. 6Quick edits: sed
  7. 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

Keep going

Day 4: Reading & Writing Files · Linux Command Line · SkillBld