On Thu, Dec 31, 2009 at 9:23 PM, James Youngman <j...@gnu.org> wrote: > On Thu, Dec 31, 2009 at 10:05 PM, Peng Yu <pengyu...@gmail.com> wrote: >> I know I can used wc -l to get the number of lines in a file. Could >> somebody let me know how to search for files that have fewer than n >> lines? (n is a number) > > min=73 # or whatever minimum you like. > find . -type f -print0 | xargs -r -0 wc -l /dev/null | awk -vn="$min" > '$2 != "/dev/null" && $2 != "total" && $1 < n {print $2;}' > > The thing with the "/dev/null" there is to ensure that wc will always > print the filename (which it won't if there is always one argument) by > ensuring that wc is always passed more than one argument.
This looks complicate for me to read. In order for me to understand how the above command does the job, do you have brief introductory material for findutils?