Introduction to Linux shell commands
Chapter 2: Commands
Visualising Files
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
andtail
you can specify the number of lines to show with-n #
- for both
cat file1 file2 file3
concatenates files and prints them in orderless fileName
prints the file however, shows you less at a time. You can use the arrow keys to scroll through the document. To exitless
typeq
.wc fileName
shows line, word and character count