Re: looking for a BASH tool

2016-06-27 Thread Richard England

On 06/27/2016 07:46 AM, SternData wrote:

Years ago, I used a tool called CED and PCED on DOS systems.  I could
type in "abc" and press an up-arrow and it would walk back through my
stack of DOS commands showing only those with "abc" in them.

There's *got* to be a similar tool for bash, but my google-fu is weak today.

Thanks for suggestions or links.


look for 'command line editing in bash'  The default mode is emacs style 
controls for moving through history and on a line to insert and delete. 
There is also a 'vi' mode set up by entering 'set -o vi' that does the 
same thing.

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Emmett Culley
On 06/27/2016 07:56 AM, Chris Adams wrote:
> Once upon a time, SternData  said:
>> Years ago, I used a tool called CED and PCED on DOS systems.  I could
>> type in "abc" and press an up-arrow and it would walk back through my
>> stack of DOS commands showing only those with "abc" in them.
>>
>> There's *got* to be a similar tool for bash, but my google-fu is weak today.
> 
> control-R is bound to reverse-search-history by default.  That will
> search anywhere in previous commands, so for example typing "s" followed
> by ^R would show matches for "ls".
> 
> If instead you want to search for commands with the same start (so just
> typing "s" would only show commands that started with "s"), you want
> history-search-backward, which is bound to PageUp on Fedora (not bound
> by default upstream IIRC).
> 
I use the following in bashrc

if [ "$PS1" ]; then 
 
  bind '"\e[A"':history-search-backward 
 
  bind '"\e[B"':history-search-forward  
 
  bind '"\e[23~"':"\"\C-k\C-ahistory | grep '^ *[0-9]* *\C-e.'\C-m\""   
 
  bind '"\e[24~"':kill-whole-line   
 
  bind Space:magic-space
 
  shopt -s histappend   
 
  export PROMPT_COMMAND='history -a'
 
if

This privides the same functionality you mentioned for windows plus: F12 erases 
the current command line without executing it, F11 will show the entire history 
of commands that start with any character typed on the command line before 
pressing F11.

The shopt part is supposed to insure that each new command line executed is 
saved immediately in the history file, instead of when the shell is closed.

Emmett
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Steven Stern
perfect. Thanks!

Yes, everyone, I know about grep. :-)

On Mon, Jun 27, 2016 at 10:12 AM, FS  wrote:

> On Mon, Jun 27, 2016 at 10:56 AM, Chris Adams  wrote:
>
>> Once upon a time, SternData  said:
>> > Years ago, I used a tool called CED and PCED on DOS systems.  I could
>> > type in "abc" and press an up-arrow and it would walk back through my
>> > stack of DOS commands showing only those with "abc" in them.
>> >
>> > There's *got* to be a similar tool for bash, but my google-fu is weak
>> today.
>>
>> control-R is bound to reverse-search-history by default.  That will
>> search anywhere in previous commands, so for example typing "s" followed
>> by ^R would show matches for "ls".
>>
>> If instead you want to search for commands with the same start (so just
>> typing "s" would only show commands that started with "s"), you want
>> history-search-backward, which is bound to PageUp on Fedora (not bound
>> by default upstream IIRC).
>>
>> --
>> Chris Adams 
>>
>>
> I have this snippet in my .bashrc that binds the up and down keys to
> search for the commands starting with the characters that you type in, so
> if you type "ls" and press the up key, it will bring up the last command
> that started with ls
>
> if [[ $- == *i* ]]
> then
>   bind '"\e[A": history-search-backward'
>   bind '"\e[B": history-search-forward'
> fi
>
> Basti
>
>
> --
> users mailing list
> users@lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>
>
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Tom Killian
Once upon a time, SternData  said:
> Years ago, I used a tool called CED and PCED on DOS systems.  I could
> type in "abc" and press an up-arrow and it would walk back through my
> stack of DOS commands showing only those with "abc" in them.
>
> There's *got* to be a similar tool for bash, but my google-fu is weak
today.

In addition to keyboard shortcuts...

history | grep abc | less

If what you're looking for came from a different, now closed, terminal
window, try

grep $HISTFILE abc | less
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread FS
On Mon, Jun 27, 2016 at 10:56 AM, Chris Adams  wrote:

> Once upon a time, SternData  said:
> > Years ago, I used a tool called CED and PCED on DOS systems.  I could
> > type in "abc" and press an up-arrow and it would walk back through my
> > stack of DOS commands showing only those with "abc" in them.
> >
> > There's *got* to be a similar tool for bash, but my google-fu is weak
> today.
>
> control-R is bound to reverse-search-history by default.  That will
> search anywhere in previous commands, so for example typing "s" followed
> by ^R would show matches for "ls".
>
> If instead you want to search for commands with the same start (so just
> typing "s" would only show commands that started with "s"), you want
> history-search-backward, which is bound to PageUp on Fedora (not bound
> by default upstream IIRC).
>
> --
> Chris Adams 
>
>
I have this snippet in my .bashrc that binds the up and down keys to search
for the commands starting with the characters that you type in, so if you
type "ls" and press the up key, it will bring up the last command that
started with ls

if [[ $- == *i* ]]
then
  bind '"\e[A": history-search-backward'
  bind '"\e[B": history-search-forward'
fi

Basti
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Chris Adams
Once upon a time, SternData  said:
> Years ago, I used a tool called CED and PCED on DOS systems.  I could
> type in "abc" and press an up-arrow and it would walk back through my
> stack of DOS commands showing only those with "abc" in them.
> 
> There's *got* to be a similar tool for bash, but my google-fu is weak today.

control-R is bound to reverse-search-history by default.  That will
search anywhere in previous commands, so for example typing "s" followed
by ^R would show matches for "ls".

If instead you want to search for commands with the same start (so just
typing "s" would only show commands that started with "s"), you want
history-search-backward, which is bound to PageUp on Fedora (not bound
by default upstream IIRC).

-- 
Chris Adams 
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Richard Shaw
On Mon, Jun 27, 2016 at 9:46 AM, SternData 
wrote:

> Years ago, I used a tool called CED and PCED on DOS systems.  I could
> type in "abc" and press an up-arrow and it would walk back through my
> stack of DOS commands showing only those with "abc" in them.
>
> There's *got* to be a similar tool for bash, but my google-fu is weak
> today.


$ history | grep "abc"

But you will have different histories per virtual terminal I think...

Richard
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


Re: looking for a BASH tool

2016-06-27 Thread Mark Haney
Uh, the history command?  history | grep 

Or there's the UP arrow in the terminal. Does what that DOS tool did.



On Mon, Jun 27, 2016 at 10:46 AM, SternData 
wrote:

> Years ago, I used a tool called CED and PCED on DOS systems.  I could
> type in "abc" and press an up-arrow and it would walk back through my
> stack of DOS commands showing only those with "abc" in them.
>
> There's *got* to be a similar tool for bash, but my google-fu is weak
> today.
>
> Thanks for suggestions or links.
>
>
> --
> -- Steve
> --
> users mailing list
> users@lists.fedoraproject.org
> To unsubscribe or change subscription options:
> https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
> Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
> Have a question? Ask away: http://ask.fedoraproject.org
>



-- 

Mark Haney ::: Senior Systems Engineer
*VIF* *International Education*
P.O. Box 3566 ::: Chapel Hill, N.C. 27515 ::: USA
919-265-5006 office

Global learning for all.
www.viflearn.com
Find VIF on Facebook  |
Twitter  | LinkedIn


Recognized as a ‘Best for the World’
 B Corp!
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


looking for a BASH tool

2016-06-27 Thread SternData
Years ago, I used a tool called CED and PCED on DOS systems.  I could
type in "abc" and press an up-arrow and it would walk back through my
stack of DOS commands showing only those with "abc" in them.

There's *got* to be a similar tool for bash, but my google-fu is weak today.

Thanks for suggestions or links.


-- 
-- Steve
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://lists.fedoraproject.org/admin/lists/users@lists.fedoraproject.org
Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org