I was tossed into Linux at work and have no experience with it what so ever. The guy that's training me gives me little tasks to figure out as I go, and I'm stuck. Today he told me to tar a file and split it into smaller files. I figured that out pretty quick. Then he told me to tar a file and split it in one command. I'm using a GoPro file GOPR0005.MP4, and have managed to do it with:

tar -czvf - GOPR0005.MP4 | split -b 5M

but my outputs are xaa, xab, ect. How can I name my outputs to something like goproaa, goproab, ect...? This is driving me crazy.


You can specify the prefix that way:

tar -czvf - GOPR0005.MP4 | split -b 5M - gopro

- is used to tell split to use stdin just like you use it to tell tar to use stdout.

  • I'm mad at myself now. I've tried to put the gopro everywhere in there, but I didn't use the -. This has been a many hour long issue. Thanks! – ShawnDobie Feb 24 '16 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.