LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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


Reply
  Search this Thread
Old 11-10-2005, 11:23 AM   #1
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Rep: Reputation: 35
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.
 
Old 11-10-2005, 11:47 AM   #2
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
It's probably "split" to cut, and "cat" to merge.
 
Old 11-10-2005, 01:28 PM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Perhaps something like:
tar -cvzf - source_file | split -b 700m - tarpiece-
cat tarpiece-* > filename.tar.gz
 
Old 11-10-2005, 08:06 PM   #4
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
Thanks, makuyl.
 
Old 12-29-2005, 12:38 PM   #5
nappy501
Member
 
Registered: Mar 2004
Location: UK
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136

Rep: Reputation: 15
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
 
Old 12-29-2005, 07:20 PM   #6
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
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
 
Old 12-31-2005, 11:41 AM   #7
nappy501
Member
 
Registered: Mar 2004
Location: UK
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136

Rep: Reputation: 15
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.

Regards

Nappy
 
Old 12-31-2005, 12:01 PM   #8
kornerr
Member
 
Registered: Dec 2004
Location: Russia, Siberia, Kemerovo
Distribution: Slackware
Posts: 893

Original Poster
Rep: Reputation: 35
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
 
Old 12-31-2005, 03:42 PM   #9
nappy501
Member
 
Registered: Mar 2004
Location: UK
Distribution: Redhat 9, then Fedora Core 2, Suse 10.0, 10.2 now 11.3
Posts: 136

Rep: Reputation: 15
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
 
Old 12-31-2005, 03:52 PM   #10
Poetics
Senior Member
 
Registered: Jun 2003
Location: California
Distribution: Slackware
Posts: 1,181

Rep: Reputation: 49
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!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Desktop size forwarded via SSH too big debian_dummy Debian 2 07-27-2004 09:33 AM
xorg server font size too big countcobolt Linux - Software 0 07-21-2004 03:20 PM
deploytool window size - too big! mikal Linux - Software 1 07-12-2004 10:32 PM
Screen size too big, I lose the last lines! 000 Linux - Newbie 4 11-13-2003 07:45 AM
X screen size to big in slackware darin3200 Slackware 24 03-15-2003 08:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 09:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration