LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-16-2009, 10:11 AM   #1
joeldick
LQ Newbie
 
Registered: Aug 2009
Posts: 26

Rep: Reputation: 4
How to get tab auto complete in bash to scroll through all possible choices


If there are more than one possible choices, pressing <tab> twice will display them. How to I get it to scroll through each choice each time I press <tab> (like in dos)? For example, if I have:

file2
file3
file_old

then:

> fi<tab>
> file2<tab>
> file3<tab>
> file_old

Thanks.
 
Old 09-16-2009, 11:05 AM   #2
pingu
Senior Member
 
Registered: Jul 2004
Location: Skuttunge SWEDEN
Distribution: Debian preferably
Posts: 1,318

Rep: Reputation: 124Reputation: 124
Use <ctrl><r> for this.
So in terminal, press <ctrl> and <r> simoultaneously* and then type in a few letters. Press <ctrl><r> to get to next command etc.
Here is a link to a quick-sheet http://"http://www.catonmat.net/down...eat-sheet.pdf"
and a pretty handy idea:
http://www.lunix.com.au/blog/searchi...ng-and-ctrl-r/

* (Did I spell that correctly? Looks kinda weird...)
 
Old 09-16-2009, 12:38 PM   #3
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
pingu,
Your first link is "not found". Try this
( And it's "simultaneously" but no matter )

Thanks for the "cheat sheet".
 
Old 09-16-2009, 01:12 PM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Servers: Debian Squeeze and Wheezy. Desktop: Slackware64 14.0. Netbook: Slackware 13.37
Posts: 8,563
Blog Entries: 29

Rep: Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179Reputation: 1179
Interesting links but joeldick was asking about command completion, not searching command history ...
 
Old 09-16-2009, 03:42 PM   #5
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Debian "Jessie"
Posts: 6,038

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Quote:
Interesting links but joeldick was asking about command completion
I know of no easy way to implement the "like in DOS" behaviour you'd like for bash completion. Maybe someone else does.

But, for the full story, see /etc/bash_completion

It's "just" a script, but that's where bash completion happens and its behaviour is defined.

It's 9400 lines for my version and is very cryptic to my eye (you'll need to be up to speed on bash awk perl & sed, to follow it, but if you'd like a different ("improved"), behaviour, this is the place to look, and tweak the code. Make a backup before you begin!

Also remember that there are many different shells you can use: zsh csh ksh ... the list goes on and on. They all offer different features. Maybe try some of them out.
 
Old 04-06-2011, 05:27 PM   #6
Worrab
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
Windows-style auto completion for bash

I just discovered an easy answer on another forum. Add the following command to your .bashrc file
(or just execute it directly):

bind '"\C-i": menu-complete'
 
  


Reply


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
Tab does not auto-complete in terminal General Fedora 8 09-12-2013 02:48 AM
Bash auto-complete of environment variables armandino101 Linux - General 11 12-20-2012 06:22 AM
auto scroll license agreement in bash doronunu Linux - General 2 12-27-2007 02:22 AM
Bash script using tab complete sadarax Programming 6 01-30-2007 09:21 PM
bash auto-complete behaviour changes acid_kewpie Linux - Software 5 10-26-2002 02:32 PM


All times are GMT -5. The time now is 02:02 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