First page Back Continue Last page Overview Graphics
Example 2-3: Redirection >
In Example 1-1, we found number of lines having “Pg “ words and printed them into the screen. The number of lines were large so they ran out of the screen and we can not easily count them. To count the number of Pg phase lines, we first redirect output (>) to a temporary file called junk and then count number of lines inside file junk using command wc.
[aghods@ghods example1]$ grep "Pg " collect.out > junk
[aghods@ghods example1]$ wc -l junk
352 junk
We can see that 352 Pg phases exist inside the collect.out catalog file.