LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-03-2018, 02:12 PM   #31
keefaz
LQ Guru
 
Registered: Mar 2004
Distribution: Slackware
Posts: 6,230

Rep: Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724Reputation: 724

Quote:
Originally Posted by Pomerano View Post
This also worked, thank you! Although I just can't tell how, at the moment... (+1)
It's just terminal escape sequences sent to cat via standard input (cat -)

<esc> [0;10r = Enable scrolling from line 0 to line 10
<esc> [0J = Clear screen from cursor down
 
1 members found this post helpful.
Old 02-03-2018, 03:30 PM   #32
Pomerano
LQ Newbie
 
Registered: Jan 2018
Posts: 22

Original Poster
Rep: Reputation: Disabled
(Heads up - The solution is found summarized and reviewed in this very post)

This thread has now been officially solved and I would like to reach out to all of you here at Linuxquestions.org, who made this happen.
By the time I wrote this I understood a lot more regarding this topic. So, for you future googlers, let me enlighten you:

Cat is a non-interactive tool and only has one move and one move only. It does it really well but that is also all it does. Look it up for yourself: "whatis cat" or "man cat", for that matter. (source: linux.die.net - man pages/Linux documentation).
The solution I was looking for goes by the name of UUOC and stands for "Useless Use of Cat". - Obvious, right?
Now, UUOC has a lot of solutions to do this, however, for the sake of it, I will only show the ones that personally worked for me. Referring to this thread as the main source.
tail and more is my "go-to" for this:
Code:
tail -1 /var/log/messages
or
cat /var/log/messages | tail -1

This will only show the last (based on the value -1) log/part of the file of which you wish to cat.
and
Code:
more -1 var/log/messages
or
cat var/log/messages | more -1

This will only summon the last row (based on the value: -1) of the log/file, followed by a binding button to your key "RETURN/ENTER".
The reason to why I did not find a solution to this very issue was mainly because every answer discluded the command "cat" as a part of the natural result.
Luckily, I now know that removing Cat is just a matter of personal reference, as it's just a bit more effective and a more natural way of using it. In other words, it is not at all necessary for the task itself, to be performed properly.

This method is called "piping", by the way, and it could be compared to the procedure that is involved in water transmission - Where, in this case, Cat would be the "big-mother-pipe" (so to speak) - who transmits the massive gallons of water - while the water pipes, connecting it to the water tap (a tool to UUOC), which lets you contain it with ease in comparison to the "big-mother-water-pipe". So, to summarize this example: Cat cannot be contained and therefore must be "piped" to a more containable environment, which in this case would be a UUOC like "tail" or "more".


On a side-note: I understand if this was a hard nut to crack since I had misinterpreted the use of Cat. So to the people on the first page, I apologize for misleading you.
Ultimately many many thanks to the people who tried to help me on my journey and special thanks to those who provided me the information of which helped me solve this puzzle once and for all!

Special credits goes to:
scasey - for providing the method of using "tail" AND (the crucial method of) displaying that Cat can still be included!!!
jefro - for mentioning the method "more".
allend - for mentioning UUOC and for providing the use of the tool LESS.
keefaz - for giving the tool "X-terminal", along with a further explanation on how it works.
pan64 - for asking the right questions and providing a number of UUOC-tools
syg00 - for giving the expression of "piping" which gave a clear understanding of the range of it can be used.
dugan and hydrurgan - for the laughter and for stating the obvious (which I did not know back then) that CAT can NOT, by any means, be tempered with alone.



If you found this post helpful, please mark this post as helpful *duh*.


Thank you for reading through
Yours sincerely,
Pom

Last edited by Pomerano; 02-03-2018 at 04:36 PM.
 
Old 02-04-2018, 04:20 AM   #33
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 13,088

Rep: Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142Reputation: 4142
Thumbs up great

Quote:
Originally Posted by Pomerano View Post
On a side-note: I understand if this was a hard nut to crack since I had misinterpreted the use of Cat. So to the people on the first page, I apologize for misleading you.
I don't think you are misleading us. As you wrote you have misunderstood something, but now you know more (or less. or cat. or most ... whatever ...).

I have to say I'm now really surprised and I'm glad you have finally found that solution.
 
  


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
any cat people here ? one crazy cat s/woman/man/g here. ////// General 46 02-02-2018 11:13 AM
difference :: cat file_1 & cat < f_1 tushar_pandey Linux - Newbie 4 08-16-2012 09:19 AM
Cat 6 Cat 5e cable question babbab Linux - Networking 1 04-07-2010 02:33 PM
cat in asm/ cat --show-all option Tux Linux - Software 1 09-02-2006 09:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:05 AM.

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