N
N
Nick Sparrow2017-02-01 16:02:13
linux
Nick Sparrow, 2017-02-01 16:02:13

How to copy contents of multiple files pre-selected into one file?

Hello! Suggest the best solution.
You need to copy content from files of a specific extension to a separate file. The files are in different folders.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
R
Rsa97, 2017-02-01
@DzirtDouren

find . -name *.c -exec cat {} \; >> destination

S
Spetros, 2017-02-01
@Spetros

A script that contains all the paths to these files.

A
Alexander, 2017-02-01
@NeiroNx

cat /home/user/file1 >> /home/user/file
cat /home/user/file2 >> /home/user/file
cat /home/user/file3 >> /home/user/file

L
Leonid, 2017-02-01
@zzevaka

find. -name *.c | xargs cat > output_file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question