...And then there is the Eshell-way. It uses Elisp under the hood when needed. Therefore it is OS-independent:
Open an Eshell via M-x
eshell
.Change directory in the Eshell to the one you want with
cd YourDirectoryPath
.Concatenate all files you want in Eshell with
cat Pattern*You*NeedPattern*Of*Source*Files > targetFile
.
Note, emacs -Q
uses Elisp for all above steps under Ubuntu (WSL):
~ $ which cd
eshell/cd is a compiled Lisp function in ‘em-dirs.el’.
~ $ which cat
eshell/cat is a compiled Lisp function in em-unix.el.