Example of wildcards and the -d option

Assuming the tree structure below, each of the following commands would give the output indicated.

command

output

% ls

teacher         that      these   

thine           this      those

% ls th??

that            this

% ls these

ann             amy       other

tracy

% ls th??e

these:

ann             amy       other

tracy

 

those:

bob             fred      friends

mike

% ls t*

teacher         that      thine           this

 

these:

ann             amy       other

tracy

 

those:

bob             fred      friends

mike

% ls  -d t*

teacher         that      these   

thine           this      those

% ls -d th*

that            these     thine           this            those

% ls th*

that            thine     this

 

these:

ann             amy       other

tracy

 

those:

bob             fred      friends

mike