Inspecting the contents of files is a frequent task. cat filename concatenates and prints the whole file to the screen, which is fine for short files but unwieldy for large ones. Piping through less, as in cat file | less, allows page-by-page navigation using Space to advance, b to go back, and q to quit. For quick checks, head filename shows the first ten lines and tail filename shows the last ten; the -n flag adjusts that count, and tail -f follows a file in real time, making it ideal for watching logs grow.
When you need to create or modify file contents directly from the terminal, two editors dominate. nano is the friendlier option: open a file with nano file, save with Ctrl+O, and exit with Ctrl+X. Vim is more powerful but has a steeper learning curve. It operates in modes — Normal mode for navigation and commands, Insert mode (entered with i) for typing, and Visual mode (v) for selecting text. From Normal mode, :w saves, :q quits, and :wq saves and quits together.
Whenever you are unsure how a command behaves, Linux offers built-in documentation. command --help prints a short usage summary, while man command opens the full manual page, navigated with the same keys as less and exited with q. These references are invaluable for discovering flags and behaviors without leaving the terminal.