Name
complete
Synopsis
complete [options]command …
Specifies the way to complete arguments for each command. This is discussed in the section Programmable Completion, earlier in the reference.
Options
-aSame as
-A alias.-AtypeUse type to specify a list of possible completions. The type may be one of the following:
aliasAlias names.
arrayvarArray variable names.
bindingBindings from the readline library.
builtinShell built-in command names.
commandCommand names.
directoryDirectory names.
disabledNames of disabled shell built-in commands.
enabledNames of enabled shell built-in commands.
exportExported variables.
fileFilenames.
functionNames of shell functions.
groupGroup names.
helptopicHelp topics as allowed by the help built-in command.
hostnameHostnames, as found in the file named by $HOSTFILE.
jobJob names.
keywordShell reserved keywords.
runningNames of running jobs.
serviceService names (from /etc/services).
setoptValid arguments for
set -o.shoptValid option names for the shopt built-in command.
signalSignal names.
stoppedNames of stopped jobs.
userUsernames.
variableShell variable names.
-bSame as
-A builtin.-cSame as
-A command.-CcommandRun command in a subshell and use its output as the list of completions.
-dSame as
-A directory.-eSame as
-A export.-fSame as
-A file.-FfunctionRun shell function function in the current shell. Upon its return, retrieve the list of completions from the COMPREPLY array.
-g ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access