March 2002
Beginner
504 pages
10h 47m
English
In the last section we looked at listing files and directories with the ls command. In this section we will look at the cat and wc commands. The cat command lets you view the contents of a file. The wc command gives you information about the number of words and lines in a file.
To view the contents of a file, we can use the cat (short for concatenate) command as follows:
cat [opts] file1 ... fileN
Here opts are one or more of the options understood by cat, and file1...fileN are the names of the files whose contents should be printed. The options, opts, are optional and can be omitted. Two commonly used options are discussed later in this section.
The following example illustrates the use of cat:
$ cat fruits
This command ...
Read now
Unlock full access