Name

complete

Synopsis

                     complete [string [word/pattern/list[:select]/[suffix]]]

List all completions, or, if specified, all completions for string (which may be a pattern). Further options can be specified.

Options for word

c

Complete current word only, without referring to pattern.

C

Complete current word only, referring to pattern.

n

Complete previous word.

N

Complete word before previous word.

p

Expect pattern to be a range of numbers. Perform completion within that range.

Options for list

Various lists of strings can be searched for possible completions. Some list options include:

(string)

Members of the list string

$variable

Words from variable

`command`

Output from command

a

Aliases

b

Bindings

c

Commands

C

External (not built-in) commands

d

Directories

D

Directories whose names begin with string

e

Environment variables

f

Filenames

F

Filenames that begin with string

g

Groups

j

Jobs

l

Limits

n

Nothing

s

Shell variables

S

Signals

t

Text files

T

Text files whose names begin with string

u

Users

v

Any variables

x

Like n, but prints select as an explanation with the editor command list-choices

X

Completions

select

select should be a glob pattern. Completions are limited to words that match this pattern. suffix is appended to all completions.

Get Mac OS X Panther in a Nutshell, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.