wild cards on find and ls

find -name *{.GIF,.gif} is wrong.

This command is first expanded by the shell to find -name *.GIF *.gif

Then further expanded to :

find -name file_BSD.GIF  file_linux.gif 
# as you have only these files in directory

Now this -name file_BSD.GIF file_linux.gif is passed to find. And this is wrong as there is no switch like file_linux.gif that is accepted by find.

What you need is this command.

find -name '*.GIF' -or -name '*.gif'

Assuming you want to collect .gif files in a case insensitive manner, this find command becomes,

find -iname '*.gif'

Note the single quotes (') here. It means *.GIF should be sent to find as is without any shell expansion. And find will use this as pattern. This single quote is necessary unless you escape the shell meta-characters. In that case the command would look like

find -iname \*.gif

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)