7/17/2008

Move up and down in a linux command line terminal

How do i move up and down in a linux command line terminal?

You can use page up and page down. If in a shell without a scroll bar or at one of the non-graphic shells, then alt-page up alt-page down works, sometimes it is shift, it just depends on what your keyboard mappings are and what flavour of distro you are running.

If you want to see a history of your commands, then type history

If you want to execute one of your historical commands you could do something like:

> history

1 blah blah blah
2 blah blah blah
3....

To execute it just type
!2
Hit enter and bam, you just executed what ever was in your history at line 2.

In your bashrc or what ever other shell you are using, you can set up the length of your history - I think it defaults to about a thousand lines.

0 comments: