help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-bash] Command completion with '*'


From: Arkadiusz Drabczyk
Subject: Re: [Help-bash] Command completion with '*'
Date: Sun, 22 Nov 2015 16:15:28 +0000 (UTC)
User-agent: slrn/1.0.2 (Linux)

On 2015-11-21, Peng Yu <address@hidden> wrote:
> Hi,
>
> My current configuration of bash only allow me to complete a command
> with its prefix. For example, if I type TAB after 'ls', I will see the
> commands starting with `ls`.
>
> Sometimes, too many commands are shown, and I want to restrict what
> are shown. For example, I may want to type TAB after 'ls*f', so that
> 'lsof' will be shown but other commands not ending with 's' will not
> be shown. Is this feature available in bash?
>

Interesting.  I don't know how to do it off the top of my head and if
it's even possible but you can start with something like this:

$ alias "c=compgen -c | egrep "
$ c "^ls.*f"
lsof

-- 
Arkadiusz Drabczyk <address@hidden>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]