This is an archived version of the course. Please find the latest version of the course on the main webpage.

Chapter 2: Commands

Visualising Files

face Harry Coppock

Use the following commands to view files in terminal.

  • head fileName shows the first few lines of a file (default 10)
  • tail fileName shows the last few lines of a file (default 10)
    • for both head and tail you can specify the number of lines to show with -n #
  • cat file1 file2 file3 concatenates files and prints them in order
  • less fileName prints the file however, shows you less at a time. You can use the arrow keys to scroll through the document. To exit less type q.
  • wc fileName shows line, word and character count