Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
11-10-2005, 11:23 AM
|
#1
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Rep:
|
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?
Thanks.
|
|
|
11-10-2005, 11:47 AM
|
#2
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
It's probably "split" to cut, and "cat" to merge.
|
|
|
11-10-2005, 01:28 PM
|
#3
|
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107
Rep:
|
Perhaps something like:
tar -cvzf - source_file | split -b 700m - tarpiece-
cat tarpiece-* > filename.tar.gz
|
|
|
11-10-2005, 08:06 PM
|
#4
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
Thanks, makuyl.
|
|
|
12-29-2005, 12:38 PM
|
#5
|
Member
Registered: Mar 2004
Location: UK
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136
Rep:
|
Quote:
Originally Posted by makuyl
Perhaps something like:
tar -cvzf - source_file | split -b 700m - tarpiece-
cat tarpiece-* > filename.tar.gz
|
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?
Sorry if this sounds really basic
Nappy
|
|
|
12-29-2005, 07:20 PM
|
#6
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
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:
|
|
|
12-31-2005, 11:41 AM
|
#7
|
Member
Registered: Mar 2004
Location: UK
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:
|
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.
Regards
Nappy
|
|
|
12-31-2005, 12:01 PM
|
#8
|
Member
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893
Original Poster
Rep:
|
Of course, you can rename it. xaa, xab, etc are just parts of the splitted file.
You can merge them back this way:
Code:
cat xa* > my_home_dir.tar.bz2
|
|
|
12-31-2005, 03:42 PM
|
#9
|
Member
Registered: Mar 2004
Location: UK
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136
Rep:
|
Quote:
Originally Posted by kornerr
Of course, you can rename it. xaa, xab, etc are just parts of the splitted file.
You can merge them back this way:
Code:
cat xa* > my_home_dir.tar.bz2
|
Hi
Thank you very much again. Your explanations have been clear and concise. That's what you need when your a newbie.
Now if I could get you to come around to my house and get my scanner, usb port, card reader and camera to work I'd be well away
Happy New Year!
Nappy
|
|
|
12-31-2005, 03:52 PM
|
#10
|
Senior Member
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181
Rep:
|
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!
|
|
|
All times are GMT -5. The time now is 08:40 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|