如何打印文本文件中 x - y 行的字符数?
我尝试使用 wc -m filename.txt
但我不知道如何限制搜索。
最佳答案
你可以使用
head -y filename | tail -(y-x+1) | wc -m
关于Linux:文本文件中第 'x' 行到 'y' 行的字符数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47168552/
如何打印文本文件中 x - y 行的字符数?
我尝试使用 wc -m filename.txt
但我不知道如何限制搜索。
最佳答案
你可以使用
head -y filename | tail -(y-x+1) | wc -m
关于Linux:文本文件中第 'x' 行到 'y' 行的字符数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47168552/