Linuxlab

Reading text

When something breaks, the first thing you do is look in files: in logs, in configs. Opening a whole big file is awkward, so there are commands to peek at the start, the end, or just count the lines. In this lesson you work with a ready five-line file and do not change it - you only look.

The file ~/poem.txt is already in the sandbox: five lines, one word each.

What to understand

Viewing is reading a file without changing it. Every command in this lesson only reads; the file stays the same.

head and tail are the start and the end of a file. In a big log those are usually what you want: the first lines or the freshest ones.

file is a command that looks at the contents and tells you what kind o

Locked

The rest of this lesson is part of a paid course

You are reading the open part. Buy the course to unlock the whole lesson and its lab.

See the course