PDA

View Full Version : [ubuntu] Short key to command histroy in terminal running bash



sk_forum
January 20th, 2011, 09:20 PM
Hi,
In windows command prompt, F8 key can cycle through your previously entered commands i.e say you enter "ping google.com" and then "pushd <dir>". Next when you type p and then press F8 brings pushd and next F8 brings ping command. You can then hit enter to execute the corresponding command i.e ping in this case.

Is there anything similar in Ubuntu Terminal running bash? Very handy to get back previously entered commands.

Thanks!

Krytarik
January 21st, 2011, 07:49 AM
I just use the up/down arrow keys, between the main keys and the keypad:
https://help.ubuntu.com/community/UsingTheTerminal#Save%20on%20typing

nothingspecial
January 21st, 2011, 10:41 AM
Press Ctrl-R (together)

start typing a command, for example - sudo

Keep pressing Ctrl-R to cycle back through all the commands in your bash history that start with sudo :D

Is that what you mean?

sk_forum
January 21st, 2011, 06:00 PM
Thanks for replies.

Krytarik (http://ubuntuforums.org/member.php?u=1187548) - Yes, up & down arrow keys could work but I leave my terminal open long enough that the list get too big.

nothingspecial - Close. Although typing first letter (say s for sudo) and then F8 is simpler, I can think I can live with Ctr-R way in ubuntu/bash world. Thanks.