Reading files

The cat command

Shows the whole content of a file. It also joins several on screen.

Syntax

cat [archivo]...

Most useful options

-AShows the invisible characters

Copy-ready examples

$ cat Documentos/tareas.txtRead a file
$ cat Documentos/tareas.txt Documentos/apuntes.txtTwo files in a row
$ cat Documentos/notas.mdA third file

You can try them in the browser terminal: it does not touch your computer.

Typical mistakes

  • With long files it floods the screen: use less for that.

Related commands

FAQ

Does cat work for huge files?

It works, but it is uncomfortable: use less to read calmly.

Learn to actually use it

The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.

Start the free course