是否有命令在 cat 文件时显示目录/文件名?
例如:假设两个文件 f1.txt 和 f2.txt 在 ./tmp 下
./tmp/f1.txt
./tmp/f2.txt
Run Code Online (Sandbox Code Playgroud)
然后当我做cat ./tmp/*.txt 时,只会显示文件的内容。但是如何首先显示文件名,然后显示内容?,例如:
(The needed command):
./tmp/f1.txt:
This is from f1.txt
and so on
./tmp/f1.txt:
This is from f2.txt ...
Run Code Online (Sandbox Code Playgroud)
有命令可以执行吗?(“cat”似乎没有显示文件名的选项)