Friday, May 3, 2024
11
rated 0 times [  11] [ 0]  / answers: 1 / hits: 8267  / 1 Year ago, mon, april 24, 2023, 5:12:57

Suppose you type a command in terminal after Enter you will see a list which more than one page. Now you want to read the result from the beginning and you should scroll up. So if you put some commands before your last one its a bit difficult to scroll the the last one --at least for me -- So I need any key switch which show the screen from the last command.



ps: I want to screen show the last command by key switch. Is there any key switch like CTRL+ L which clear the screen. less command show the screen page by page.


More From » command-line

 Answers
7

There isn't one as far as I know. You have a few choices though:




  1. Pipe the output through less or more



    command | less

  2. Hit the up until you find the command you ran and run it again (optionally using less or more again).


  3. Run the previous command through less using history expansion.



    !! | less

  4. Use a terminal that supports searching through the scroll back. The image below is showing my preferred terminal, terminator (installable with sudo apt-get terminator) but Ubuntu's default terminal also supports this. Just hit Ctrl Shift F to show the search bar. If you then search for either the command's name or your username (which appears in your prompt) you will be taken directly back to the last command:



    enter image description here



[#25100] Tuesday, April 25, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nalystcul

Total Points: 390
Total Questions: 106
Total Answers: 115

Location: Tokelau
Member since Sun, May 7, 2023
1 Year ago
;