16:53 - Saturday, 19 April 2014

Count Lines In Files From Set

I need to count the number of lines in files from a set.

I tried to execute

find -name pattern -exec vc -l '{}' ;

But this command returns

find: `vc': No such file or directory

@Gilles is right, the command is called wc. The following does the job:

find -name pattern -exec wc -l '{}' ;

An alternative without using find might also do the job:

wc -l pattern

Share

Advertisement

Comment