How to cut a big file into pieces of a certain size?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How to cut a big file into pieces of a certain size?
I want to archive a big file, then cut it to fit several CDs.
Then copy these pieces from CDs, and make these pieces one big file back again.
How can I accomplish it?
Hi,
I have been looking for a way to split files. I think the line above may be what I want. If you could clarify for me.
I have a main hard drive and and secondary hard drive. Every so often I back up my home directory with the following ( a friend gave it to me).
su then cd /
tar cvf /mnt/shared/homemonth.tar /home/nappy
This creates a tar file on my second hard drive. I then burn them onto a cd. However the files are now too big to burn onto a cd. My last backup was 906mb. My second hard drive has now run out of space as I have 4.1gb of tar files.
I presume I would have to do the above command and then burn the bits to cd?
I am unclear about the above command and I would like to understand it before I use it. Do I type it as you have written it?
I presume I would type:
tar -cvzf - /home/nappy | split -b 650m - tarpiece-
I have to have all those dashes? Would this then create the bits of the tar file in my home directory, which I could then burn to cd?
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136
Rep:
Quote:
Originally Posted by kornerr
First, you'd better back up like this:
Code:
tar -cjf /mnt/shared/home_month.tar.bz2 /home/nappy
That will save your space.
Then you can
Code:
split -b 700m /mnt/shared/home_month.tar.bz2
FYI:
Code:
man split
Hi,
Thank you so much for that. It makes more sense to me like that. Command, the size you want and the file to do it to. The tar files are already sitting on my second hard drive.
So I tried it out, took me a while to find the bits. The original file was 906mb. I found the bits called xaa and xab in the root directory. I then burned them to CD.
Just two questions, if I wanted to get the file back, now it is on two cds, what would I do? The second question is can I rename xaa and xab, to something more meaningful. I am being careful to write on all the cd's, but they are all going to have files called xaa and xab.
If you check the HCL (link at the top of the page), which stands for "Hardware Compatibility List," for your specific hardware, you'll see the success stories of others and how they got that same hardware to work for them!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.