9052 shaares
Count lines in a file:
# wc -l file.txt
If wc not installed, line count with only bash:
# LINECT=0; while read -r LINE; do (( LINECT++ )); done < file.txt; echo $LINECTCount lines in a file:
# wc -l file.txt
If wc not installed, line count with only bash:
# LINECT=0; while read -r LINE; do (( LINECT++ )); done < file.txt; echo $LINECT