For using cat
to output *.txt
files within a specific directory, how can I insert the filename as a "break" before each file?
file #1
contents of file
file #2
contents of file
ideally as an easy to remember few bash
commands.
see also:
One more option to @0stone0 answer
You can use tail
insted of cat:
tail -n +1 *
Output:
==> file-1.txt <==
contents of file
==> file-2.txt <==
contents of file