Chapter 6
Reading and editing text
Updated July 3, 2026
To see a whole file, there is cat:
$ cat /etc/hostnameFor a large file cat is awkward: it dumps everything at once and the start scrolls away. Then you use less:
$ less /var/log/syslogInside less, the arrows and PageUp/PageDown scroll, /word searches forward, n repeats the search, q quits. Often you only need the edges of a file:
$ head notes.txt # first 10 lines
$ head -n 3 notes.txt # first 3 lines instead of 10
$ tail notes.txt # last 10 lines
$ tail -f /var/log/syslog # follow new lines as they are writtenFor editing, nano is enough in Part I. I
Locked
The rest of this chapter is part of a paid course
You are reading the open part. Buy the course to read the whole chapter.