我用来cat -n
获取文件中内容的行列表.txt
。
[$] cat exam.txt
1 let's see how far does this go, and if it works or not. if not till where it
2 goes and what happens after that. In nano, things are much more better than in X
3 text editors as there is no set fill therein as there is in nano and hence are
4 much worse off.
在 dpkg 中似乎没有这样做,或者有吗?我正在 Debian 测试并运行 dpkg 1.18.18 。只是为了让列表不那么麻烦,我使用 head -
[$] dpkg -L nano | head
/.
/bin
/bin/nano
/etc
/etc/nanorc
/usr
/usr/share
/usr/share/doc
/usr/share/doc/nano
/usr/share/doc/nano/AUTHORS
因为我正在使用 head,所以我知道这些是 10 行或 10 个文件,考虑到 .也作为一个文件。我确实尝试过类似的事情 -
$ dpkg -nL nano
但出现错误,它不知道该选项。
如果不可能,请告诉我,以便我可以将其作为功能请求提交到dpkg
.
答案1
dpkg -L nano | cat -n
就可以了...(它会计算目录和文件。)
如果你只想要总数,
dpkg -L nano | wc -l