First page Back Continue Last page Overview Graphics
Example 2-2: The wc command
As a geophysicist, in many cases we need to know how many lines are inside a given file. To find number of lines inside collect.out file in the directory example1, we use command wc -l collect.out
[aghods@ghods example1]$ wc -l collect.out
2079 collect.out
The command shows that the collect.out file has 2079 lines. The -l after command wc is called a switch. Majority of Linux commands accepts switches which somehow modify their behavior. The -l switch makes wc to prints only number of lines and ignore printing other info like number of words in the document.