LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-20-2009, 09:43 PM   #1
olepholks
LQ Newbie
 
Registered: Sep 2009
Location: Texas
Distribution: Mepis 8-32
Posts: 13

Rep: Reputation: 0
cat


I have a question on how to use cat. where does it belong? Thanks.

I need to join 2 avi files. cat man instructions deal with text files, and don't seen to work on avi files.

Last edited by olepholks; 09-20-2009 at 10:24 PM. Reason: ignorance
 
Old 09-20-2009, 09:51 PM   #2
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
The manual page shows the basic usage of cat; you could also check the manual page for bash and scroll to the section titled "Here Documents" for some slightly more complex usages.

cat is short for "concatenate", and is often used to read files, like:

shell$ cat filename # this will read the file "filename" to the screen.

For the manual, type:

shell$ man cat

Or, if there's some particular usage case that you are not understanding, please post us an example, or provide more detail of exactly what you wish to know about cat.

Sasha

PS - you should create a more informative title for your thread(s) -- an example would be:
"Please tell me about the `cat` command-- how to use it?"
You can edit this thread title by clicking EDIT, then click GO-ADVANCED, and fix up the title

Cheers!

Last edited by GrapefruiTgirl; 09-20-2009 at 09:56 PM.
 
Old 09-20-2009, 10:20 PM   #3
olepholks
LQ Newbie
 
Registered: Sep 2009
Location: Texas
Distribution: Mepis 8-32
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by GrapefruiTgirl View Post
The manual page shows the basic usage of cat; you could also check the manual page for bash and scroll to the section titled "Here Documents" for some slightly more complex usages.

cat is short for "concatenate", and is often used to read files, like:

shell$ cat filename # this will read the file "filename" to the screen.

For the manual, type:

shell$ man cat

Or, if there's some particular usage case that you are not understanding, please post us an example, or provide more detail of exactly what you wish to know about cat.

Sasha

PS - you should create a more informative title for your thread(s) -- an example would be:
"Please tell me about the `cat` command-- how to use it?"
You can edit this thread title by clicking EDIT, then click GO-ADVANCED, and fix up the title

Cheers!
Is this the way to reply??? I'm still trying to find out how to use this site. If so:
need to join 2 avi files, man pages deal only in text files. (??) and the example does not work for me,
 
Old 09-21-2009, 12:30 AM   #4
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Hello,
append the content of file2 to file1 :
Code:
cat file2 >> file1
echo the content of file1 and the content of file2 on stdout :
Code:
cat file1 file2
Quote:
I need to join 2 avi files. cat man instructions deal with text files, and don't seen to work on avi files.
cat works fine, but don't expect to have a nice avi file when concatenating two of them. Chances are they are out of sync (think of the headers etc).
From http://linuxclues.blogspot.com/2008/...avi-files.html, to join two avi files with mencoder :
Code:
mencoder -oac copy -ovc copy -forceidx foo1.avi foo2.avi -o foo.avi
 
Old 09-21-2009, 03:47 AM   #5
GrapefruiTgirl
LQ Guru
 
Registered: Dec 2006
Location: underground
Distribution: Slackware64
Posts: 7,594

Rep: Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556Reputation: 556
Quote:
Originally Posted by olepholks View Post
Is this the way to reply??? I'm still trying to find out how to use this site. If so:
need to join 2 avi files, man pages deal only in text files. (??) and the example does not work for me,
Yes, that's a pretty good way to reply, I thought.

And it was effective: it caused you to provide more detail about what exactly you're trying to do, AND it educated you about an aspect of using this site

Sasha
 
Old 09-21-2009, 04:14 AM   #6
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Arch + Xfce
Posts: 6,852

Rep: Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037Reputation: 2037
The real answer is that it all depends on the file type. Some formats like mp3 have an atomic structure, where each individual subsegment contains all the playback information necessary for that segment. This kind of format can be easily combined by cat without affecting playback ability (though you may have issues with things like metadata tags).

But AFAIK the avi container isn't one of those. It uses a single header at the beginning of the file to define the playback parameters for the whole file. You generally have to rebuild the whole container if you edit the media inside it. This means you need to use a dedicated video editor, such as mencoder or ffmpeg.
 
Old 09-21-2009, 12:11 PM   #7
olepholks
LQ Newbie
 
Registered: Sep 2009
Location: Texas
Distribution: Mepis 8-32
Posts: 13

Original Poster
Rep: Reputation: 0
O.K. Now I've posted a dum question, gotten very good answers, so now how do I respond to whomever has been kind enough to provide me with the needed help, or "yep, I tried that, didn't work" response. ?? Is this block the correct place for this?? Or: Where's the operating manual for navigasting this site?
 
Old 09-21-2009, 12:24 PM   #8
olepholks
LQ Newbie
 
Registered: Sep 2009
Location: Texas
Distribution: Mepis 8-32
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by antegallya View Post
Hello,
append the content of file2 to file1 :
Code:
cat file2 >> file1
echo the content of file1 and the content of file2 on stdout :
Code:
cat file1 file2
cat works fine, but don't expect to have a nice avi file when concatenating two of them. Chances are they are out of sync (think of the headers etc).
From http://linuxclues.blogspot.com/2008/...avi-files.html, to join two avi files with mencoder :
Code:
mencoder -oac copy -ovc copy -forceidx foo1.avi foo2.avi -o foo.avi
Is this the spot for answering a particular person who has offered help? If so: thanks, I got mencoder installed, (I think) but when I tried to use it per instructions I got the "command not found " message.
is reboot required?
 
Old 09-21-2009, 12:25 PM   #9
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
Quote:
Where's the operating manual for navigasting this site?
In Tutorials/LinuxQuestions.org/How to Use LinuxQuestions.org.
That is there :
http://www.linuxquestions.org/linux/...xQuestions_org
you'll find some reading about that.

Quote:
how do I respond to whomever has been kind enough to provide me with the needed help
David the H. has in his signature :
Quote:
And when you get an answer:
a) Post a follow-up comment letting people know it worked.
b) Thank those who've helped you (click the thumb icon).
c) Mark the thread as "solved" (located in the "thread tools).
 
Old 09-21-2009, 12:27 PM   #10
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Just keep posting in th thread unless you feel the topic has changed so much athat a new thread is approriate. In this case you started asking about cat and it looks like the topic is changing to mencoder and ffmpeg.

Regards an LQ user guide I don't know of one. Just by lurking you'll see how things are done and the regular posters are pretty friendly and will keep you pointed in the right direction. Relax. Enjoy
 
Old 09-21-2009, 12:29 PM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
To see if mencoder is installed
in a terminal type
Code:
whereis mencoder
To install mencoder, this depends on your distribution.
Which didtribution are you using ?
 
  


Reply



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
cat onelinefile.txt >> newfile.txt; cat twofile.txt >> newfile.txt keep newline? tmcguinness Programming 4 02-12-2009 06:38 AM
Using cat readline within cat readline while loop demxkn66 Programming 5 12-16-2007 05:10 PM
how can i do cat? ZAMO Linux - General 6 05-04-2007 12:52 AM
cat in asm/ cat --show-all option Tux Linux - Software 1 09-02-2006 09:31 PM
Cat intervade Linux - Newbie 7 05-21-2006 02:18 PM

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

All times are GMT -5. The time now is 04:47 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
Open Source Consulting | Domain Registration