There are two major commands used in Unix for listing files, cat and more. I've talked about both of them in Chapter .
cat [-nA] [file1 file2 ...fileN]
cat is not a user friendly command--it doesn't wait for you to read the file, and is mostly used in conjuction with pipes. However, cat does have some useful command-line options. For instance, n will number all the lines in the file, and A will show control characters as normal characters instead of (possibly) doing strange things to your screen. (Remember, to see some of the stranger and perhaps ``less useful'' options, use the man command: man cat.) cat will accept input from stdin if no files are specified on the command-line.
more [-l] [+linenumber] [file1 file2 ...fileN]
more is much more useful, and is the command that you'll want to use when browsing ASCII text files. The only interesting option is l, which will tell more that you aren't interested in treating the character as a ``new page'' character. more will start on a specified linenumber.
Since more is an interactive command, I've summarized the major interactive commands below:
head [-lines] [file1 file2 ...fileN]
head will display the first ten lines in the listed files, or the first ten lines of stdin if no files are specified on the command line. Any numeric option will be taken as the number of lines to print, so head -15 frog will print the first fifteen lines of the file frog.
tail [-lines] [file1 file2 ...fileN]
Like head, tail will display only a fraction of the file. Naturally, tail will display the end of the file, or the last ten lines that come through stdin. tail also accepts a option specifying the number of lines.
file [file1 file2 ...fileN]
The file command attempts to identify what format a particular file is written in. Since not all files have extentions or other easy to identify marks, the file command performs some rudimentary checks to try and figure out exactly what it contains.
Be careful, though, because it is quite possible for file to make a wrong identification.