Results 1 to 7 of 7
-
10-03-2005, 11:25 PM #1WHT Addict
- Join Date
- Jun 2004
- Posts
- 135
How to split and merge each file in SSH?
What's the command to split and merge each file in SSH?
My English is poor. Please tell me when I make a mistake so that I can improve.
-
10-04-2005, 03:27 AM #2Junior Guru
- Join Date
- Oct 2002
- Posts
- 229
I'm not exactly sure what you're looking for but
Code:split and cat
-
10-04-2005, 03:50 AM #3WHT Addict
- Join Date
- Jun 2004
- Posts
- 135
Can you show me some example command?
I have a file, "abc.tgz"
How to split it and merge it afterthat?My English is poor. Please tell me when I make a mistake so that I can improve.
-
10-04-2005, 04:01 AM #4Newbie
- Join Date
- Oct 2005
- Location
- .au
- Posts
- 12
If you have a file abc.tgz, try
tar -zxvf abc.tgz
to decompress it and extract the files (it is a gzipped tar archive). This should open up the archive and you should end up with a directory of files, say "dirname" with all your files under it. Depending on how the archive was made, all the files may just be extracted to the current directory
When you have done what you want, you can recreate the archive with
tar -cf abc.tar dirname
where dirname is the name of the directory where all the files you want to archive reside. Finally you want to gzip it,
gzip abc.tar
You should now have abc.tar.gz, which you can rename to abc.tgz if you want or just leave it as a tar.gz.
-
10-04-2005, 10:54 AM #5Web Hosting Evangelist
- Join Date
- Sep 2005
- Location
- Essex, England
- Posts
- 548
If you have a 10MB file (abc.tgz)
and you want to split it into 1MB chunks
split -b 1048576 abc.tgz
It will create 10 files xaa xab xac xad xae etc.
To make one file at the other end
cat xaa xab xac etc. > abc.tgz
You could also do cat xa? > abc.tgz
(? is the wildcard for one character only)
-
10-05-2005, 03:20 AM #6WHT Addict
- Join Date
- Jun 2004
- Posts
- 135
Thanks guys!
I will try it outMy English is poor. Please tell me when I make a mistake so that I can improve.
-
10-05-2005, 10:48 AM #7Need Moar KAWFEE
- Join Date
- Apr 2003
- Location
- Atlanta, Jawja
- Posts
- 3,074
http://www.umiacs.umd.edu/~jusub/uni...s/19270095.htm covers what Blapto said, a bit more in depth though.
Doug Hazard - "retired" Web Hosting Master
* Full Stack (Web/WP) Dev for The Catholic Diocese of Richmond (160+ sites)
* Sports Photographer, Media Personality and CFB Historian
* Tech Admin for several Sports Networks/Sites