Untitled

mail@pastecode.io avatar
unknown
plain_text
22 days ago
505 B
2
Indexable
Never
#!/bin/bash

read -p "enter your directory for search: " path
echo ""
countall=0
allline=0
allword=0
for x in `find $path -type f`
do

((countall++))
line=`cat $x | wc -l`
word=`cat $x | wc -w`
allline=$((allline + line))
allword=$((allword + word))
echo "$x --- line= $line ---- word= $word"
echo "-----------------------------------" 

done

echo "------------------------------------------------------------------"
echo "in your directory : --> files= $countall lines= $allline words= $allword"
echo ""
Leave a Comment