← Shell Scripting (Bash) learning path
Shell Scripting (Bash) · Module 3 of 10

Viewing and editing text

Read and edit files in the terminal.

📖 Key ideas

  1. cat prints a file; less pages through it.
  2. head and tail show the start and end; tail -f follows logs.
  3. Editors: nano (simple), vim (powerful).
  4. wc counts lines, words, characters.
  5. echo "text" > file writes; >> appends.
💡 Real-life example: tail -f is watching a live cricket scoreboard: new lines appear as they happen.
catPrints file contents
lessScrollable file viewer
tail -fFollows a growing file
nanoSimple terminal editor