Benches macOS

2

Binary copy in terminal

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

In an MS Dos command prompt, if I am in a directory with many binary files with numerically-ordered file names, (i.e. fragment.dat.001 fragment.dat.002 fragment.dat.003 ...)

I can type

"copy /b fragment* file.dat"

and it will combine all the files together, in order.

Is this possible in the Mac OS X Terminal?

If so, what is the command?

2 replies

Sign in or join Beachball Help to reply.

  1. 0

    Michael Conniff

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Well, given you are in the correct directory

    cat fragment* > file.dat

    should do it.

    But, when you say "in order", you'd better check first what order the wildcard will put the files in. You can do this easily with

    echo fragment*

    This will list everything in one long line, but that's fine, it's what the command expects.

  2. 0

    Karan Karia

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks man. It worked great.

    Didn't realize it would be as simple as the
    cat command!

    Its even faster than Windows's binary copy. I combined 10 100 MB files in a matter of seconds.

    🙂