Viewing Contents of Text Files
Linux for Programmers and Users, Section 3.15
Viewing Complete Files
cat [options][file-list]
Viewing files One Page at a Time
more
-
more
View file contents one page at a time. Use space bar to advance; b
key to go backwards. Advance passed the end of a file or type q to
exit.
SYNOPSIS
more file
less
-
less
A newer, alternatire to more to view file contents one page at a
time. Use space bar or f to advance; b key to go backwards.
Searching within a file is much like vi (/ or ?)
Use q to exit.
SYNOPSIS
less file
Viewing the Head or Tail of a File
head
-
head
Output the fist part of files
SYNOPSIS
head [option] [FILE] ...
-
-n, --lines=[-]N
print the first N lines instead of the first 10; with the leading -,
print all but the last N lines of each file
tail
-
tail
Output the last part of files
SYNOPSIS
tail [option] [file-list]
-
-n, --lines=N
print the last N lines instead of the last 10
-
-f
output appended data as the file grows