Monday, July 13, 2009

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

Umm, I've seen plenty of documentation on all the commands in Linux, but I haven't seen how to perform the most simplest thing like moving up and down through the terminal to view what commands you've done and what help files you've displayed. Just the keyboard replacement for using the scrollwheel would be great. Thanks.

How to move up and down in a linux command line terminal?
It depends on the terminal..





Page Up or Shift + Page Up will usually do the trick.
Reply: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:





%26gt; 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.


No comments:

Post a Comment