Can I combined multiple .out files with the cat command in bash or csh? Additionally I want only the header of first file to be concatenated and I was thinking of using the tail function for that. Anyone know if this is possible or of a way to do this?

  • 2
    .out files created by what?
    – HalosGhost
    Commented Jul 16, 2014 at 4:36

2 Answers 2


To concatenate files

cat file1 file2 file3 > output

To get the first N lines of a file

head -n N file

To get the first N lines of file1 and then concatenate all the other files

head -n N file | cat - file1 file2 file3 > output

Cat will read standard input from the piped command (- argument) and concatenate it with the specified files.



If by .out you mean the binary executable files on linux then probably you will have to learn the eLF file format of linux to find the size of header and the using head you can concatenate the header of the file.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .