[英]how to pipe ls into cat with xargs so that filenames are listed?
對於使用cat
到 output *.txt
特定目錄中的文件,如何在每個文件之前插入文件名作為“中斷”?
file #1
contents of file
file #2
contents of file
理想情況下,作為一個容易記住的幾個bash
命令。
也可以看看:
@0stone0 答案的另一個選項您可以使用 cat 的tail
insted:
tail -n +1 *
Output:
==> file-1.txt <==
contents of file
==> file-2.txt <==
contents of file
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.