Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Ubuntu User (http://www.linux-archive.org/ubuntu-user/)
-   -   How do i scroll in bash using keyboard? (http://www.linux-archive.org/ubuntu-user/607365-how-do-i-scroll-bash-using-keyboard.html)

Sushil Mantri 12-07-2011 05:53 AM

How do i scroll in bash using keyboard?
 
Thanks a lot Karl for replying but maybe i did not bring my problem clearly.

I use a gui terminal, and i want to scroll through the scroll back buffer using keyboard only. <shift> + pgup is painful as i dont use PgUp much. Also it scrolls the whole page, i want to scroll more like the mouse does, 1 line at a time. Also piping it to other files is not what i am looking for.


Any ideas?

On Tue, Dec 6, 2011 at 11:16 PM, Karl Auer <kauer@biplane.com.au> wrote:

On Tue, 2011-12-06 at 22:36 -0500, Sushil Mantri wrote:

> I have been a little bugged by this. I want to scroll up through the

> output of last executed command. I dont want to do 'less' or using

> <shift> + pageup.



Maybe you should tell us how you imagine it working. If you don't put

the output somewhere where you can read it, then your only option is the

scroll-back buffer of the terminal window.



For console terminals (i.e., if you are not using a graphical user

interface) you will probably not be able to use a mouse to scroll up,

and the shit-pgup method is about all you have. If you are using a

terminal window in a graphical user interface, then you should be able

to use the scroll wheel (of the thumb in a scroll bar) to scroll up and

down in the output of past commands. Depending on the terminal windows

software you are using you should be able to adjust the size of the

scroll-back buffer to a size that suits you. I generally set it to a

very big number.



There are a few options for storing the output from commands. Obviously

these may be less useful if the output is not text!



The "script" will put an entire session and every keystroke into a file

for later perusal:



* script

* command

* command

* command...

* exit



Or just redirect the output from a command into a file and look at it

when the command has finished ("2>&1" redirects error messages as well):



* command > file.txt 2>&1



Or you can use "tee" to redirect output into a file AND get it into

less:



* command | tee file.txt | less



Or even into multiple files:



* command | tee file1.txt | tee file2.txt | file3.txt > file4.txt



Or you can watch the output from something as it happens using tail - in

another window, or the same window if the command is running in the

background:



* command > file.txt 2>&1 &

* tail -f file.txt



Note: Command syntax off the top of my head - apply with caution :-)



Regards, K.



--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~

Karl Auer (kauer@biplane.com.au) * * * * * * * * * +61-2-64957160 (h)

http://www.biplane.com.au/kauer/ * * * * * * * * * +61-428-957160 (mob)



GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017

Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687




--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users




--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Nils Kassube 12-07-2011 06:10 AM

How do i scroll in bash using keyboard?
 
Sushil Mantri wrote:
> Thanks a lot Karl for replying but maybe i did not bring my problem
> clearly.
>
> I use a gui terminal, and i want to scroll through the scroll back
> buffer using keyboard only. <shift> + pgup is painful as i dont use
> PgUp much. Also it scrolls the whole page, i want to scroll more
> like the mouse does, 1 line at a time. Also piping it to other files
> is not what i am looking for.

At least konsole (terminal program of Kubuntu) knows the shortcut shift
+ up-arrow/down-arrow to scroll a single line at a time. Maybe your
terminal program does the same.


Nils

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Karl Auer 12-07-2011 07:57 AM

How do i scroll in bash using keyboard?
 
On Wed, 2011-12-07 at 01:53 -0500, Sushil Mantri wrote:
> I use a gui terminal, and i want to scroll through the scroll back
> buffer using keyboard only. <shift> + pgup is painful as i dont use
> PgUp much.

Shift-Ctl-Up and Shift-Ctl-Down will do what you want. At least in
gnome-terminal.

Not sure it's much of an improvement on Shift-PgUp, but it does do one
line at a time at least.

Regards, K.

--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer@biplane.com.au) +61-2-64957160 (h)
http://www.biplane.com.au/kauer/ +61-428-957160 (mob)

GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017
Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Sushil Mantri 12-07-2011 11:38 AM

How do i scroll in bash using keyboard?
 
On Wed, Dec 7, 2011 at 3:57 AM, Karl Auer <kauer@biplane.com.au> wrote:

On Wed, 2011-12-07 at 01:53 -0500, Sushil Mantri wrote:

> I use a gui terminal, and i want to scroll through the scroll back

> buffer using keyboard only. <shift> + pgup is painful as i dont use

> PgUp much.



Shift-Ctl-Up and Shift-Ctl-Down will do what you want. At least in

gnome-terminal.



Not sure it's much of an improvement on Shift-PgUp, but it does do one

line at a time at least.
No, thats nice! Thanks



Regards, K.



--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~

Karl Auer (kauer@biplane.com.au) * * * * * * * * * +61-2-64957160 (h)

http://www.biplane.com.au/kauer/ * * * * * * * * * +61-428-957160 (mob)



GPG fingerprint: AE1D 4868 6420 AD9A A698 5251 1699 7B78 4EEE 6017

Old fingerprint: DA41 51B1 1481 16E1 F7E2 B2E9 3007 14ED 5736 F687




--

ubuntu-users mailing list

ubuntu-users@lists.ubuntu.com

Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users




--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

NoOp 12-07-2011 06:50 PM

How do i scroll in bash using keyboard?
 
On 12/07/2011 04:38 AM, Sushil Mantri wrote:
> On Wed, Dec 7, 2011 at 3:57 AM, Karl Auer <kauer@biplane.com.au> wrote:
>
>> On Wed, 2011-12-07 at 01:53 -0500, Sushil Mantri wrote:
>> > I use a gui terminal, and i want to scroll through the scroll back
>> > buffer using keyboard only. <shift> + pgup is painful as i dont use
>> > PgUp much.
>>
>> Shift-Ctl-Up and Shift-Ctl-Down will do what you want. At least in
>> gnome-terminal.
>>
>> Not sure it's much of an improvement on Shift-PgUp, but it does do one
>> line at a time at least.
>>
> No, thats nice! Thanks
...
Added information: Help|Contents (or F1)|Usage|3.4 Working with the
contents of Terminal Windows
Online version is here:
<http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal-usage.html.en>
<http://library.gnome.org/users/gnome-terminal/stable/gnome-terminal-usage.html.en#gnome-terminal-contents>




--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users

Avi Greenbury 12-07-2011 07:15 PM

How do i scroll in bash using keyboard?
 
Sushil Mantri wrote:

> Thanks a lot Karl for replying but maybe i did not bring my problem
> clearly.
>
> I use a gui terminal, and i want to scroll through the scroll back
> buffer using keyboard only. <shift> + pgup is painful as i dont use
> PgUp much. Also it scrolls the whole page, i want to scroll more like
> the mouse does, 1 line at a time. Also piping it to other files is
> not what i am looking for.

What would be s less painful?

You *could* use screen and its paste buffer, but it would be worth
reading around a bit to get the hang of what screen is.

In short, though, you can start a screen session by typing

screen

and hitting enter. In that, you can scroll through the buffer by
pressing ctrl-a then [, and use the arrow keys to scroll around. ] will
then exit the scrolling mode. More accurately, ] will paste what you've
highlighted, but if you don't highlight, it just exits. Esc always
exits, but is probably further away than page up.

I'm sure there is something better suited to what you're after than
that, but I've never had cause to look for it, and nothing comes
particularly to mind.

--
Avi.

--
ubuntu-users mailing list
ubuntu-users@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


All times are GMT. The time now is 03:11 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.