Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
682 views
in Technique[技术] by (71.8m points)

bash - How can I copy several binary files into one file on a Linux system?

I need to copy the content of a folder which contains binary files to one binary file in another directory.

In Windows I can just use:

copy file1 + file2 targetfile /B 

I couldn't find something similar for Linux (I saw an approach with cat, but I'm unsure if this really works for binary files).

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Unix has no distinction between text and binary files, which is why you can just cat them together:

cat file1 file2 > target_file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...