Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to know the meaning of compgen options. With help compgen I can get help page. But it shows only the option lists. There is no explanation for it.

compgen: compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist] [-F function] [-C command] [-X filterpat] [-P prefix] [-S suffix] [word] Display possible completions depending on the options.

Intended to be used from within a shell function generating possible
completions.  If the optional WORD argument is supplied, matches against
WORD are generated.

Exit Status:
Returns success unless an invalid option is supplied or an error occurs.

Especially I want know how -abcdefgjksuv arguments works.

share|improve this question
up vote 0 down vote accepted

Near the bottom of the bash man page is the section SHELL BUILTIN COMMANDS where it says

compgen [option] [word]
          Generate  possible  completion  matches  for  word according to the
          options, which may be any option accepted by the  complete  builtin
          with the exception of -p and -r, and write the matches to the stan-
          dard output.  When using the -F or -C options,  the  various  shell
          variables  set  by  the  programmable  completion facilities, while
          available, will not have useful values.

          The matches will be generated in  the  same  way  as  if  the  pro-
          grammable  completion  code had generated them directly from a com-
          pletion specification with the same flags.  If word  is  specified,
          only those completions matching word will be displayed.

          The  return  value is true unless an invalid option is supplied, or
          no matches were generated.

Just below it is the complete builtin command which explains the switches.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .