Cat command: View file contents
Example: cat-n/etc/passwd view passwd file and add line number
Cat-b/etc/passwd view passwd file blank Line No line number
CAT-NS/ETC/PASSWD view passwd file plus line number and multiple consecutive blank lines Yasuo to one line
More command: View file contents
For example: MORE/ETC/PASSWD view passwd file Press Enter down a line, press the space down one screen. (but not upside down)
Less command: View file contents
Use the up and down keys to flip.
Head command: View the contents of the file (typically used for directional lookups) (the first 10 lines are displayed by default)
For example: Head-n 5/etc/passwd View the first 5 lines of the passwd file.
Tail Command: View the contents of the file (10 rows by default) (Count backwards)
For example: Tail-n 3/etc/passwd View the passwd file after 3 lines.
Example: Head-n 5/etc/passwd | Tail-n 3 View the last 3 lines of the first 5 rows in the passwd file.
View file commands in Linux