Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
10-15-2004, 10:53 AM
|
#1
|
|
LQ Newbie
Registered: Oct 2004
Posts: 8
Rep:
|
F8 for command history in bash
Hi all,
In Windows command prompt, I can type a word and hit F8 to iterate the history of that word. For example, if I type "java ThisProgram" and then later type "java "ThatProgram" I can just enter "java" and hit F8 and it will cycle through those 2 entries and complete the statements on the command line.
I was wondering if there is anything like this in the bash shell on Linux. I know about up/down arrow keys and this is useful, but I am very used to F8.
many thanks,
Barry
|
|
|
|
10-15-2004, 11:45 AM
|
#2
|
|
Senior Member
Registered: Nov 2002
Location: pikes peak
Distribution: Slackware, LFS
Posts: 2,577
Rep:
|
in the ~/home directory is a hidden file..........
~/.bash_history
you can create your own keyboard shortcut to it............
|
|
|
|
10-15-2004, 12:56 PM
|
#3
|
|
LQ Newbie
Registered: Oct 2004
Posts: 8
Original Poster
Rep:
|
But how will creating a keyboard shortcut to a file help? 
|
|
|
|
10-15-2004, 02:10 PM
|
#4
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
I think Ctrl r might be what you have in mind.
For example....
If I run these commands.
cd /home/stuff
ls -al
cd /root
ls -l
cd /mnt/tech
ls -r
then I can use the command: Ctrl r
and if I type l it comes up with the last command which started with l
pressing the Ctrl r again finds the previous command which started with l
.....
|
|
|
|
10-15-2004, 02:56 PM
|
#5
|
|
LQ Newbie
Registered: Oct 2004
Posts: 8
Original Poster
Rep:
|
Hmmmm... Well that functionality is what I am looking for, but when I do CTRL-R I get a message, "(reverse-i-search)" What am I missing? Do I need a key mapping or something?
thanks,
Barry
|
|
|
|
10-15-2004, 03:09 PM
|
#6
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
After you do Ctrl r then you type in the search word or even just part of it and the reverse search will find the last instance of that word or letter. Pressing Ctrl r again finds the next previous instance of that word or letter.
|
|
|
|
10-15-2004, 03:23 PM
|
#7
|
|
LQ Newbie
Registered: Oct 2004
Posts: 8
Original Poster
Rep:
|
Got it! Cool! Thanks a lot homey!
|
|
|
|
10-15-2004, 03:25 PM
|
#8
|
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
You're welcome. 
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 10:27 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|