Linux:文本文件中第 'x' 行到 'y' 行的字符数

标签 linux unix

如何打印文本文件中 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/

相关文章:

c++ - Linux - 哪些资源需要提升权限的 C/C++ 编程?

unix - 如何将进程放入 "uninterruptible sleep"?

linux - Unix返回电话号码,需要格式化

shell - Script 和 Scriptreplay 给我带来了一些问题

c - C 中的文件 I/O 困难

linux - 杀死在子 shell 中运行的 tftp 命令

linux - Expect 脚本 - 发送字符串所需的引号与 expect 所需的引号冲突

linux - 将参数附加到 $PATH 的 Bash 脚本

c - 共享内存权限段 block c Linux

UNIX 中的 java.lang.NoClassDefFoundError