LinuxQuestions.org
Help answer threads with 0 replies.
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 04-19-2004, 09:32 PM   #1
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Rep: Reputation: 15
what are the limits to the 'cat' command?


I use the cat to combine text files all the time but when I went to cat a series of .sxc files nada, didn't work. So then I look and the man page for cat and there's sooooo much that I can barely focus.
So maybe a side issue is - is there a way to 'search' a manpage listing? Rather than reading it line by laborious and irrelevant line?

1] What are the limits to concatenation?
2] Where would I be able to find that information without bugging all of you- helpful folks?
3] Is there a way in a terminal to 'search a manpage listing?

BTW I was trying to 'cat' files that were all in the same directory with a new name into that same directory as I have done daily for txt files.

thanks in advance-j
 
Old 04-19-2004, 09:41 PM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
1. Shouldn't be any. (Maybe some problem with files over 4GB; probably not)
2. Source code of cat.
3. Hit '/', the string you are looking for and enter
 
Old 04-19-2004, 09:45 PM   #3
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
don't know much about the cat options, i mainly use it with grep or just to read stuff or print it to the screen.

you can search in man pages in a terminal with the slash key followed by what you're searching for:

/pattern

then if you press "n" it'll highlight all occurrences, and will scroll to the next one each time you press it.
 
Old 04-20-2004, 06:49 AM   #4
slick_willie
Member
 
Registered: May 2003
Posts: 46

Rep: Reputation: 15
Wouldn't using tar be a better way to do that?
 
Old 04-20-2004, 08:59 AM   #5
synaptical
Senior Member
 
Registered: Jun 2003
Distribution: Mint 13/15, CentOS 6.4
Posts: 2,020

Rep: Reputation: 48
Quote:
Originally posted by slick_willie
Wouldn't using tar be a better way to do that?
tar is an archiving utility. it's basically for putting a bunch of files into one file so you can compress them if you want, kind of like winzip or winrar in windows.

man rar
 
Old 04-20-2004, 09:13 PM   #6
slick_willie
Member
 
Registered: May 2003
Posts: 46

Rep: Reputation: 15
Yeah, I thought that is what he was doing with cat, just appending all his files into one.
 
Old 04-20-2004, 09:28 PM   #7
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Original Poster
Rep: Reputation: 15
Slick-
you are sort of correct -however I need to be able to use the software on the 'large' file as a separate unit and at the same time be able to alter the other files if the need arises.
So I thought that tar would compress everything and that would not be what I was looking for.

I ended up just pasting all the data into a new file and working from there since cat didn't work.
I suspect it's the nature of the .sxc file that won't allow it to work correctly with cat but I have no idea how to even figure that out.

So- I'm wrong? Tar just appends files into one large single openable file? Instead of compressing a bunch of files that have to be 'untarred' and then you still have 'a bunch of files'.???

The books never talk about tar that way. So I need the education.
j
 
Old 04-20-2004, 09:44 PM   #8
SciYro
Senior Member
 
Registered: Oct 2003
Location: hopefully not here
Distribution: Gentoo
Posts: 2,038

Rep: Reputation: 51
wasn't tar just made to "compress" files into a disk archive?

anyways, if i remember right tar's compression isn't really a compression at all, it just puts files back to back so they don't waste space..

block file systems put 1 file into a block, since some files don't fill blocks or not even completely.. tar lets you put them into 1 file, making the FS use the space more efficiently as its now 1 file, thus less wasted space for unused parts of blocks
 
Old 04-21-2004, 03:47 AM   #9
slick_willie
Member
 
Registered: May 2003
Posts: 46

Rep: Reputation: 15
I just tar'd about twenty files, Example:
tar -cvf TXTfiles.tar *.TXT
After that I was able to use a more command on the file and it worked. Tar doesn't compress, just organizes. You can compress the tar file, then use zcat or gunzip -c I believe to view it.
 
Old 04-21-2004, 04:55 AM   #10
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Are you trying to concatenate the contents of many sxc files? It can't be done by just concatenating the files itself together, because sxc is internally a compressed xml document and you cannot create new compressed file by just concatenating them in row in the first place; you should uncompress them, catenate and compress again. Also just catenation is not enough for combining xml files, because there are structural information that has to be taken into account.
 
Old 04-21-2004, 09:28 PM   #11
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Original Poster
Rep: Reputation: 15
Wow- Toni
Thanks for the precise info.
However what tools does one use to uncompress such a file?
What is the whole command process?
Thanks.
j
 
Old 04-22-2004, 09:46 AM   #12
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
Uncompressing is easy: unzip foo.sxc
But now you have 4-6 files containing various information about the document: metadata describing who has written the document and when (meta.xml), settings (settings.xml), style and formatting information (styles.xml) and the contents itself (content.xml).

These files are human readable, espesially when you save the document without xml compression that leaves the spaces and enters out (Tools->Settings->Load&Save->General). While spending some time to read those files through, you see that combining them is not trivial to be automated. If you really want to automatically do it, easiest way for it is by writing a xslt document describing the combination and using xslt parser (like xerces) to process the document.
 
Old 04-22-2004, 04:32 PM   #13
Frybyte
Member
 
Registered: Nov 2003
Location: Seattle in a hut
Distribution: Simply mepis and it's soooo nice !!!
Posts: 71

Original Poster
Rep: Reputation: 15
Thank you for the explanation. I really appreciate it.
j
 
  


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
MSDOS version for cat command frankie_DJ General 9 07-22-2005 08:08 AM
cat command for text files minm Linux - Newbie 5 07-03-2005 12:32 AM
how to run cat command in silent mode user_linux Linux - Newbie 4 06-16-2005 10:21 AM
cat command juanb Linux - Newbie 4 08-19-2004 11:14 AM
cat Command Moeses Linux - General 1 06-20-2002 03:27 AM

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

All times are GMT -5. The time now is 07:20 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration