Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's 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.
i have a linux server running CentOS. i currently use the command:
tar -cvf foldername.tar foldername/
to tar a folder, but i would like to be able to make folder that are over 100mb in size tar into multiple tar files no bigger then 100mb. so if a folder is 350mb, split it into 3 x 100mb tar's and 1 x 50mb tar. i know how to use the "split" command, but i cant use that if i download to a windows pc and try to unzip it, as i need it for people who use winrar/etc to unpack files.
so in short...any ideas of way to tar the folder into filename.part1.tar, filename.part2.tar, etc???? so it can be unrar'd in windows?
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101
Rep:
Well, you can't unrar a tar file -- i think what you mean is to untar it?
Semantics aside, splitting and combining files in linux is fairly easy -- just use the split command to make bite-sized chunks of your file, and then cat them together again.
Split is easy enough, you're already in linux when you make the tar (presumably). So you just need to cat them together again in windows... http://unxutils.sourceforge.net/ has a cat.exe utility. I would have to poke around a bit more to find a way to redirect that input into a file in windows (you may be better off with something like http://www.steve.org.uk/Software/bash/, a windows port of the bash shell, and then use the cat.exe tool from there to redirect it all into files).
I know this is kind of a kludge, but at the moment it's the only thing I can think of.
Split is easy enough, you're already in linux when you make the tar (presumably). So you just need to cat them together again in windows...
Indeed there are plenty free softwares to "split and merge" files in Windows. Also a simple dos command should do the job:
Code:
copy /b splitted_files.* joined_file.tar /b
You should only instruct windows people to use the command line. This could be the most difficult task!
Regarding the untar of unix archives, a lot of windows applications can manage them now, including the most popular winzip and winrar and some free software.
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101
Rep:
Quote:
Originally Posted by colucix
Indeed there are plenty free softwares to "split and merge" files in Windows. Also a simple dos command should do the job:
Code:
copy /b splitted_files.* joined_file.tar /b
You should only instruct windows people to use the command line. This could be the most difficult task!
Regarding the untar of unix archives, a lot of windows applications can manage them now, including the most popular winzip and winrar and some free software.
Good to know .
Last time I used windows to do anything (I've fixed them since, and earned my A+ for it, but that doesn't really cover this sort of thing.), was a LONG time ago. I don't know, a year or two at least. I pretty much went linux cold turkey after a short time dual-booting.
Apparently things have changed a bit since I was using it. Thanks for the update.
P.S. I didn't think the windows command line would be powerful enough to do much with the split archive . I figured an external program would be pretty much required once you split the file.
well all those suggestions are good and easy if it was just me using the files, but it needs to be easy for others on windows to do it, without needing extra programs if they already have winrar or some other unrar'ing program. i already use "split" but need it to be like in windows when u rar a file and split it into 50mb files, u can just unrar the start file and it does them all.
colucix, yeah it would be easy if i could get others to use the cmd line but the world is full of lazy people lol
Distribution: Debian Gnu/Linux Lenny on AMD64x2 (32-bit mode), an AMD Sempron 64 laptop, debian, 32bit
Posts: 101
Rep:
What if you were to rar it in windows, using winrar?
I don't know exactly how the rar format deals with split archives; but if you want a split rar archive, it might be better just to use rar to split the archive .
If getting the files over to windows is a problem, we can certainly help with that.
jakykong, you hit the nail on the head! You can create the tar archive as usual. Then compress it using rar and splitting in pieces of the desired size. For example, suppose you want to compress a tar archive and split it into 10 Mbytes parts:
Code:
rar a -v10000k pippo file.tar
this will compress the archive file.tar and split it as
If you transfer the pieces on a Windows machine and double-click on the first part, winrar will take care of join the parts together and extract the tar archive. Then you can extract the archive in the usual way, since winrar can manage the tar format as well.
colucix, yeah it would be easy if i could get others to use the cmd line but the world is full of lazy people lol
Yeah... I know! But if you use the method suggested in the posts above, it's up to you to instruct lazy people to do a simple double-click on the right icon!
jakykong, you hit the nail on the head! You can create the tar archive as usual. Then compress it using rar and splitting in pieces of the desired size. For example, suppose you want to compress a tar archive and split it into 10 Mbytes parts:
Code:
rar a -v10000k pippo file.tar
this will compress the archive file.tar and split it as
If you transfer the pieces on a Windows machine and double-click on the first part, winrar will take care of join the parts together and extract the tar archive. Then you can extract the archive in the usual way, since winrar can manage the tar format as well.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.