LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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

Reply
 
Search this Thread
Old 04-21-2002, 02:00 PM   #1
u02gtt
Member
 
Registered: Apr 2002
Location: Scotland
Distribution: slackware 7, muLinux
Posts: 56

Rep: Reputation: 15
cat - joining files


does cat work with binary files?

i.e in dos i used to split large files up to transport on floppy and rejoin them with the command copy /b blargh.zip + blargh2.zip blarghoriginall.zip Can i use the cat command to do this, and if not is there a command that can do it
 
Old 04-21-2002, 05:08 PM   #2
kibble
LQ Newbie
 
Registered: Apr 2002
Posts: 14

Rep: Reputation: 0
Cat doesn't alter files since it isn't a filter like sed or awk for example. Therefore binary or ascii would make little difference to cat. However with things like binary files you just have to be sure that they can be joined like cat file1 file2 > file3. There is also a program for unix called split which will split files up.
 
Old 04-21-2002, 05:13 PM   #3
u02gtt
Member
 
Registered: Apr 2002
Location: Scotland
Distribution: slackware 7, muLinux
Posts: 56

Original Poster
Rep: Reputation: 15
ok thanks,
can i do cat file1 file2 file3 file4 file5 ...... fle16 >> file.gzip
 
Old 04-21-2002, 05:28 PM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by u02gtt
ok thanks,
can i do cat file1 file2 file3 file4 file5 ...... fle16 >> file.gzip
you could name it file.gzip but its not going to be zipped up though by just doing that and also it won't combine the files.. it puts each of the contents of the files as one file, one after the other..
say i had two files.. file1 and file2 with each containing the word: "this is a test file"
If I did a cat file1 file2 > file.txt, then I opened the file to view the contents.. it would look like this:

"this is a test file"
"this is a test file"

Now if you want to compress a bunch of files and zip them up so you can unzip them with each being a separate file.. you would just want to zip them up using either tar or any other program.. etc.
 
Old 04-21-2002, 05:36 PM   #5
u02gtt
Member
 
Registered: Apr 2002
Location: Scotland
Distribution: slackware 7, muLinux
Posts: 56

Original Poster
Rep: Reputation: 15
i've got a pile of gzips. I am on an NT box at uni now, so i have zipped them up in one package and split it into 16 parts on floppys. The way i used to combine them in dos was with copy /b. So there are 16 parts to gzips.zip, i.e 01gzip.zip 02gzip.zip etc. If i do: cat 01gzip.zip 02gzip 03gzip.zip ... >> gzip.zip will it recreate the originall file, because included in these files is gcc so i canot compile a splitting program yet


just noticed i got a member next too my name now -woo hoo


Last edited by u02gtt; 04-21-2002 at 06:04 PM.
 
Old 04-22-2002, 08:39 AM   #6
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 46
The cat command will do exactly the same as the copy /b does for windows/dos. The only thing that could go wrong is that most likely you created a windows zip file. Using the standard linux tools you can't unzip pkzip files. You will need a utility called unzip for that.
 
Old 04-22-2002, 09:49 AM   #7
u02gtt
Member
 
Registered: Apr 2002
Location: Scotland
Distribution: slackware 7, muLinux
Posts: 56

Original Poster
Rep: Reputation: 15
yeah i got it on base install. It worked, although i was confused for a while when it wouldn't unzip (i had built the file the wrong way around)
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cat 2 files without newline lea Programming 5 12-23-2010 04:54 PM
cat command for text files minm Linux - Newbie 5 07-03-2005 01:32 AM
logrotate log files - keeping in order when using grep or cat and bash dmellem Linux - Software 6 02-11-2005 02:05 PM
joining text files. chunky Programming 1 05-19-2004 11:42 AM
Joining *wmv files ? gazza Linux - Newbie 3 01-20-2004 01:48 PM


All times are GMT -5. The time now is 08:17 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration