April 15th, 2002, 09:51 AM
how to combine files
hello im new to hear and found this site by chance.
I was wondering if anyone can help me.
I would like to write a shell script that can combine files together. It doesnt have to compress them just combine....
Can anyone suggest any good web sites and what tools i should use
April 15th, 2002, 01:45 PM
You can use the cat command to concatenate files.
cat filename1 filename2 filename3 > finalfile
April 15th, 2002, 05:05 PM
I thought about catting the files in but how would i get them back into 2 seperate files.
Thanks for the reply
April 15th, 2002, 06:10 PM
Ah, then maybe you could use the tar command. Typically, a tar command to archive a bunch of files would look something like this:
tar -cvf finalfile.tar filename1 filename2 filename3 ...
tar -zcvf finalfile.tar.gz filename1 filename2 filename3 .... (if you want the tar file to be gzipped as well)
Then, to extract, you would type something like this:
tar -xvf finalfile.tar
tar -zxvf finalfile.tar.gz
I'd suggest you read the man pages for the tar command first, to determine what the various options are, before trying it out.
April 15th, 2002, 06:14 PM
thanks for that i have heard of the tar command. ill take a look at the man pages.