LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices



Reply
 
Search this Thread
Old 02-16-2010, 08:51 AM   #1
xiawinter
LQ Newbie
 
Registered: Aug 2007
Posts: 27

Rep: Reputation: 15
how to search command history beginning with what you type


in opensuse (from version 10.3 to newest), it supports shift + up/down when typing command in the terminal, which prompts the command history beginning with the typed words. The feature comforts the experience navigating in the command history, but it differs from CTRL +R. I dislike it.

Does it achieved from alias in bashrc? how can it be enabled in ubuntu?


I moved to ubuntu because of driver(wireless) problems, but I'm missing it whenever I type a word in the terminal.

Thanks for your helps.

Updated: How can we search the command history beginning with the typed words in the terminal?

Last edited by xiawinter; 02-16-2010 at 09:41 AM. Reason: clarify the question.
 
Old 02-16-2010, 09:13 AM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
"shift + page up" normally is used for paging in a terminal. I have never seen the behavior you are describing.

What terminal program were you using in SUSE?
 
Old 02-16-2010, 09:26 AM   #3
xiawinter
LQ Newbie
 
Registered: Aug 2007
Posts: 27

Original Poster
Rep: Reputation: 15
sorry for the confusion. I didn't mean page up, but the up arrow.

I used gnome-terminal on opensuse 10.3,11.0, but this feature is not available on ubuntu/debian gnome-terminal.

thanks for quick replys.
 
Old 02-16-2010, 09:30 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
On my system(KDE/Konsole), "shift + up arrow" moves up one line. "up arrow" alone steps thru the command history. (the latter is the same on all terminals I have ever used.)

Have you tried looking in the preferences for gnome-terminal?
 
Old 02-16-2010, 09:39 AM   #5
xiawinter
LQ Newbie
 
Registered: Aug 2007
Posts: 27

Original Poster
Rep: Reputation: 15
no, I didn't and I can't now because I don't have a suse installed computer.

I think it's something set in alias.

so let me change the question to "how to search command history beginning with the typed words in the terminal?"
 
Old 02-16-2010, 09:45 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729Reputation: 729
Quote:
I think it's something set in alias.
probably not--alias is not used for configuring the behavior of key combinations.
Quote:
so let me change the question to "how to search command history beginning with the typed words in the terminal?"
You are looking for "tab completion". Type a few letters and then hit the tab key.
 
Old 02-16-2010, 10:12 AM   #7
xiawinter
LQ Newbie
 
Registered: Aug 2007
Posts: 27

Original Poster
Rep: Reputation: 15
it should be not the tab key, which I use quite a lot to complete the command.

for example, I previously typed a command

Code:
ssh -D 1234 abc@host.com
and while I'm typing ssh in the terminal, the idea comes to my mind that I have ever used a ssh command, so instead of typing -D continually, I type shift +up to recall the full command.

CTRL +r doesn't help when you have words typed in the terminal except repeating typing the search keywords and ctrl r to retrieve from the command history.

I think the feature I'm expecting is something like
Code:
!ssh
but I want the alternatives because the types words are not unique.

Last edited by xiawinter; 02-16-2010 at 10:13 AM. Reason: with compliment added to describe the real requests.
 
Old 02-17-2010, 11:26 AM   #8
cmsuser
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
ubuntu

Quote:
Originally Posted by pixellany View Post
On my system(KDE/Konsole), "shift + up arrow" moves up one line. "up arrow" alone steps thru the command history. (the latter is the same on all terminals I have ever used.)

Have you tried looking in the preferences for gnome-terminal?
when i login as another user and I press up I don't get my command history, vs when I'm logged in as the "main" user on my system. do you know what configuration I'm missing?
 
Old 02-17-2010, 04:12 PM   #9
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
..
Quote:
when i login as another user and I press up I don't get my command history..[SNIP].. do you know what configuration I'm missing?
Yes, there is nothing missing.

This is normal behaviour.

history is user-specific. It gives the command history for the current user.

If you log in as another user, you'll get their history, not yours

When you think about it, this is very sensible behaviour.

Welcome to LQ, but in future, please start a new thread when you have a new question, don't "hijack" an established thread (even though it might seem to be related). This just keeps the threads tidy and easier to follow.
 
Old 10-05-2010, 04:58 AM   #10
simeos
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
Quote:
Originally Posted by xiawinter View Post
so let me change the question to "how to search command history beginning with the typed words in the terminal?"
I search to do the same thing, I found somewhere that you can add :
Code:
# MATLAB style search
"\e[A": history-search-backward
"\e[B": history-search-forward
"\e[C": forward-char
"\e[D": backward-char
to your /etc/inputrc.
With this you can found in your command history a command beginning with what you typped, by using up and down arrows. That the behaviour of Matlab command line.

hope it helps
 
  


Reply

Tags
bashrc, opensuse, terminal


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Search (not Browser) history, where is the file located in Firefox ? SChipS Linux - General 8 05-23-2010 02:25 PM
Too long on shift key. Now I cannot type. suguru Suse/Novell 1 07-09-2006 09:49 AM
ESC+/ to search command history in tcsh wycolorado Linux - Newbie 1 06-30-2006 05:20 AM
ESC+/ to search command history in tcsh wycolorado Linux - General 0 06-28-2006 07:43 PM
Search Box History List akosombo Fedora 0 05-06-2005 08:36 PM


All times are GMT -5. The time now is 12:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration