How can I keep the terminal output always at the beginning?












3














I have large output from a python script that clear the terminal and print again, but the scrollbar of terminal always is in the bottom.
screenshot showing long output



Is it possible to fix the scrollbar to the top so I could always see the beginning of the output like this:



Image 2



I need the terminal to be continuously updating but it shouldn't scroll down to the end, I need to always see the top of the output even while it is updating.



Command example:



enter image description here










share|improve this question









New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3




    Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:40
















3














I have large output from a python script that clear the terminal and print again, but the scrollbar of terminal always is in the bottom.
screenshot showing long output



Is it possible to fix the scrollbar to the top so I could always see the beginning of the output like this:



Image 2



I need the terminal to be continuously updating but it shouldn't scroll down to the end, I need to always see the top of the output even while it is updating.



Command example:



enter image description here










share|improve this question









New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
















  • 3




    Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:40














3












3








3







I have large output from a python script that clear the terminal and print again, but the scrollbar of terminal always is in the bottom.
screenshot showing long output



Is it possible to fix the scrollbar to the top so I could always see the beginning of the output like this:



Image 2



I need the terminal to be continuously updating but it shouldn't scroll down to the end, I need to always see the top of the output even while it is updating.



Command example:



enter image description here










share|improve this question









New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have large output from a python script that clear the terminal and print again, but the scrollbar of terminal always is in the bottom.
screenshot showing long output



Is it possible to fix the scrollbar to the top so I could always see the beginning of the output like this:



Image 2



I need the terminal to be continuously updating but it shouldn't scroll down to the end, I need to always see the top of the output even while it is updating.



Command example:



enter image description here







command-line scrollbar






share|improve this question









New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Dec 18 at 1:00





















New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 18 at 0:21









sebastian morales

162




162




New contributor




sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






sebastian morales is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.








  • 3




    Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:40














  • 3




    Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:40








3




3




Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
– Sergiy Kolodyazhnyy
Dec 18 at 0:40




Simply due to how terminal is implemented, it's always going to scroll down to the bottom and the last lines/characters. So always keeping first few lines on screen may be possible but it cuts against how terminals actually work and may be difficult to implement. Use less or more or another pager software as terdon's answer suggests.
– Sergiy Kolodyazhnyy
Dec 18 at 0:40










2 Answers
2






active

oldest

votes


















4














It sounds like you just want to use a pager like less or more:



$ seq 1 1000 | less


You can scroll up and down with the arrow keys and, when you've finished, hit q to exit. You can also search using /. See man less for details.



Alternatively, you can use head to only see the first few lines. For example



$ seq 1 1000 | head
1
2
3
4
5
6
7
8
9
10





share|improve this answer





















  • Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
    – sebastian morales
    Dec 18 at 0:41








  • 1




    @sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:45










  • @SergiyKolodyazhnyy I do it. Ty
    – sebastian morales
    Dec 18 at 0:48






  • 1




    @sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
    – terdon
    Dec 18 at 0:53










  • @terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
    – sebastian morales
    Dec 18 at 1:03





















1














There's an option in GNOME Terminal's Profile Preferences: Scroll on output. By default it's unchecked, and the effect is that, when a command is producing continuous output, and you scroll up at least once, then the terminal will not automatically scroll down to the latest line of output.



Unfortunately, you still do need to scroll up once when the output starts to trigger this behaviour. If that's not workable, using a pager like less is the best option.






share|improve this answer





















  • I had already activated this option, but it did not work. How can I use less with "python script.py"?
    – sebastian morales
    Dec 18 at 0:46










  • @sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
    – muru
    Dec 18 at 0:48













Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






sebastian morales is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102688%2fhow-can-i-keep-the-terminal-output-always-at-the-beginning%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























2 Answers
2






active

oldest

votes








2 Answers
2






active

oldest

votes









active

oldest

votes






active

oldest

votes









4














It sounds like you just want to use a pager like less or more:



$ seq 1 1000 | less


You can scroll up and down with the arrow keys and, when you've finished, hit q to exit. You can also search using /. See man less for details.



Alternatively, you can use head to only see the first few lines. For example



$ seq 1 1000 | head
1
2
3
4
5
6
7
8
9
10





share|improve this answer





















  • Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
    – sebastian morales
    Dec 18 at 0:41








  • 1




    @sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:45










  • @SergiyKolodyazhnyy I do it. Ty
    – sebastian morales
    Dec 18 at 0:48






  • 1




    @sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
    – terdon
    Dec 18 at 0:53










  • @terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
    – sebastian morales
    Dec 18 at 1:03


















4














It sounds like you just want to use a pager like less or more:



$ seq 1 1000 | less


You can scroll up and down with the arrow keys and, when you've finished, hit q to exit. You can also search using /. See man less for details.



Alternatively, you can use head to only see the first few lines. For example



$ seq 1 1000 | head
1
2
3
4
5
6
7
8
9
10





share|improve this answer





















  • Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
    – sebastian morales
    Dec 18 at 0:41








  • 1




    @sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:45










  • @SergiyKolodyazhnyy I do it. Ty
    – sebastian morales
    Dec 18 at 0:48






  • 1




    @sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
    – terdon
    Dec 18 at 0:53










  • @terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
    – sebastian morales
    Dec 18 at 1:03
















4












4








4






It sounds like you just want to use a pager like less or more:



$ seq 1 1000 | less


You can scroll up and down with the arrow keys and, when you've finished, hit q to exit. You can also search using /. See man less for details.



Alternatively, you can use head to only see the first few lines. For example



$ seq 1 1000 | head
1
2
3
4
5
6
7
8
9
10





share|improve this answer












It sounds like you just want to use a pager like less or more:



$ seq 1 1000 | less


You can scroll up and down with the arrow keys and, when you've finished, hit q to exit. You can also search using /. See man less for details.



Alternatively, you can use head to only see the first few lines. For example



$ seq 1 1000 | head
1
2
3
4
5
6
7
8
9
10






share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 18 at 0:30









terdon

64.1k12136212




64.1k12136212












  • Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
    – sebastian morales
    Dec 18 at 0:41








  • 1




    @sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:45










  • @SergiyKolodyazhnyy I do it. Ty
    – sebastian morales
    Dec 18 at 0:48






  • 1




    @sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
    – terdon
    Dec 18 at 0:53










  • @terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
    – sebastian morales
    Dec 18 at 1:03




















  • Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
    – sebastian morales
    Dec 18 at 0:41








  • 1




    @sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
    – Sergiy Kolodyazhnyy
    Dec 18 at 0:45










  • @SergiyKolodyazhnyy I do it. Ty
    – sebastian morales
    Dec 18 at 0:48






  • 1




    @sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
    – terdon
    Dec 18 at 0:53










  • @terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
    – sebastian morales
    Dec 18 at 1:03


















Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
– sebastian morales
Dec 18 at 0:41






Thanks for you answer, but the problem is that the script always is update the terminal so this process never end. I can't run "seq python script.py | head". What I want is for the terminal to continue updating is to be able to see always up and also thanks for the grammar corrections.
– sebastian morales
Dec 18 at 0:41






1




1




@sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
– Sergiy Kolodyazhnyy
Dec 18 at 0:45




@sebastianmorales This information should be part of the question. Please click "edit" button under your question and add this. Otherwise question is incomplete and unclear.
– Sergiy Kolodyazhnyy
Dec 18 at 0:45












@SergiyKolodyazhnyy I do it. Ty
– sebastian morales
Dec 18 at 0:48




@SergiyKolodyazhnyy I do it. Ty
– sebastian morales
Dec 18 at 0:48




1




1




@sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
– terdon
Dec 18 at 0:53




@sebastianmorales it would also help if you could give an example of a specific command you use that does this. I can't think of any tool that behaves as you describe but which doesn't already do this buffering for you. For example, top will continuously update without scrolling down, but it is designed that way.
– terdon
Dec 18 at 0:53












@terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
– sebastian morales
Dec 18 at 1:03






@terdon I add a image in the body question with a small table, what I want to see is the header like block the scrollbar on the top.
– sebastian morales
Dec 18 at 1:03















1














There's an option in GNOME Terminal's Profile Preferences: Scroll on output. By default it's unchecked, and the effect is that, when a command is producing continuous output, and you scroll up at least once, then the terminal will not automatically scroll down to the latest line of output.



Unfortunately, you still do need to scroll up once when the output starts to trigger this behaviour. If that's not workable, using a pager like less is the best option.






share|improve this answer





















  • I had already activated this option, but it did not work. How can I use less with "python script.py"?
    – sebastian morales
    Dec 18 at 0:46










  • @sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
    – muru
    Dec 18 at 0:48


















1














There's an option in GNOME Terminal's Profile Preferences: Scroll on output. By default it's unchecked, and the effect is that, when a command is producing continuous output, and you scroll up at least once, then the terminal will not automatically scroll down to the latest line of output.



Unfortunately, you still do need to scroll up once when the output starts to trigger this behaviour. If that's not workable, using a pager like less is the best option.






share|improve this answer





















  • I had already activated this option, but it did not work. How can I use less with "python script.py"?
    – sebastian morales
    Dec 18 at 0:46










  • @sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
    – muru
    Dec 18 at 0:48
















1












1








1






There's an option in GNOME Terminal's Profile Preferences: Scroll on output. By default it's unchecked, and the effect is that, when a command is producing continuous output, and you scroll up at least once, then the terminal will not automatically scroll down to the latest line of output.



Unfortunately, you still do need to scroll up once when the output starts to trigger this behaviour. If that's not workable, using a pager like less is the best option.






share|improve this answer












There's an option in GNOME Terminal's Profile Preferences: Scroll on output. By default it's unchecked, and the effect is that, when a command is producing continuous output, and you scroll up at least once, then the terminal will not automatically scroll down to the latest line of output.



Unfortunately, you still do need to scroll up once when the output starts to trigger this behaviour. If that's not workable, using a pager like less is the best option.







share|improve this answer












share|improve this answer



share|improve this answer










answered Dec 18 at 0:43









muru

1




1












  • I had already activated this option, but it did not work. How can I use less with "python script.py"?
    – sebastian morales
    Dec 18 at 0:46










  • @sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
    – muru
    Dec 18 at 0:48




















  • I had already activated this option, but it did not work. How can I use less with "python script.py"?
    – sebastian morales
    Dec 18 at 0:46










  • @sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
    – muru
    Dec 18 at 0:48


















I had already activated this option, but it did not work. How can I use less with "python script.py"?
– sebastian morales
Dec 18 at 0:46




I had already activated this option, but it did not work. How can I use less with "python script.py"?
– sebastian morales
Dec 18 at 0:46












@sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
– muru
Dec 18 at 0:48






@sebastianmorales if you check that output, then the terminal will always jump to the last line. You should leave it unchecked and scroll when the output starts. As for less, that's in terdon's answer.
– muru
Dec 18 at 0:48












sebastian morales is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















sebastian morales is a new contributor. Be nice, and check out our Code of Conduct.













sebastian morales is a new contributor. Be nice, and check out our Code of Conduct.












sebastian morales is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1102688%2fhow-can-i-keep-the-terminal-output-always-at-the-beginning%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How did Captain America manage to do this?

迪纳利

南乌拉尔铁路局