Chris B
Chris B

Reputation: 2921

Piping Contents of Files from Filepaths to Single File - UNIX

I've got a list of filepaths, and would like to get the data from each of these files into a single communal file. The list of filepaths is in a file one-per-line, so I was hoping I could do something like:

cat listofpaths.txt >> combineddata.txt

Obviously that won't work since that's just going to get me the paths rather than the stuff within them - hmm...

I could do this using Python, but I'm assuming there a 1-liner to do it using a UNIX pipeline - anyone know what it'd be?

Upvotes: 1

Views: 449

Answers (1)

arkascha
arkascha

Reputation: 42935

A simple solution:

cat listofpaths.txt | xargs cat >> combineddata.txt

Upvotes: 2

Related Questions