📜  linux 命令获取文件中的行数 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:27.009000             🧑  作者: Mango

代码示例2
echo Enter the filename
read file
w=`cat $file | wc -w`
c=`cat $file | wc -c`
l=`grep -c "." $file`
echo Number of characters in $file is $c
echo Number of words in $file is $w
echo Number of lines in $file is $l