Viewing Content
Reading Files
Dump file contents or page through long output.
cat prints a whole file to the screen — fine for short files.
less opens a pager: scroll with arrow keys, quit with q.
head and tail show the first or last lines. tail -f log.txt follows a growing log in real time.
$ Commands to try
$ cat notes.txt
$ less /var/log/syslog
$ head -n 5 notes.txt
$ tail -n 20 notes.txt
Practice exercise
Create a file with several lines (echo -e "line1\nline2\nline3"), then view it with cat, head -n 2, and tail -n 1.