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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
10-15-2004, 11: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, 12:45 PM
|
#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, 01: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, 03: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, 03: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, 04: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, 04:23 PM
|
#7
|
LQ Newbie
Registered: Oct 2004
Posts: 8
Original Poster
Rep:
|
Got it! Cool! Thanks a lot homey!
|
|
|
10-15-2004, 04:25 PM
|
#8
|
Senior Member
Registered: Oct 2003
Posts: 3,057
Rep:
|
You're welcome.
|
|
|
All times are GMT -5. The time now is 07:22 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
|
|