Passer au contenu

Reading files

English

Reading a file

  • cat prints a file's contents straight to the screen:
cat poem.txt
  • It is named after "concatenate" — it can also join several files together.

head -2 shows the first two lines of poem.txt, tail -2 the last two, and wc -l counts 6 lines

Se connecter ou créer un compte

IGCSE, A-Level & AP