I want to copy files that having 100 lines or more to another folder:
$ cd "/home/john/folder a"
$ wc -l *
Try this :
declare -i numfile for f in *; do numfile=$([ -f "$f" ] && cat $f | wc -l ) [ $numfile -ge 100 ] && cp $f otherdir done
For each files in current directory,
numfile is assigned the number of lines of the file.
numfile is greater or equal to 100, file is copied to