← Shell Scripting (Bash) learning pathShell Scripting (Bash) · Module 3 of 10
Viewing and editing text
Read and edit files in the terminal.
📖 Key ideas
- cat prints a file; less pages through it.
- head and tail show the start and end; tail -f follows logs.
- Editors: nano (simple), vim (powerful).
- wc counts lines, words, characters.
- 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