Expand wild cards in command before executing it

How about

echo rm build/* tmp/*

Or, on my version of bash, hitting tabtab immediately after the wildcard gives me a list of matching files.

To "delete files carefully", I would recommend either using the interaction flag to rm, or again prefixing with echo

echo rm -i f*o
rm -i f*o

Admittedly neither will give you the list up front as preferred, though.


It depends on the editing mode of your shell. For example I am using vi-mode and type Esc and * and the wildcards will get expanded.