Operating System - HP-UX
1833777 Members
2207 Online
110063 Solutions
New Discussion

Re: error of "find" command

 
SOLVED
Go to solution
Chen Yingjie
Frequent Advisor

error of "find" command

There are following files in the directory.

-rwxr-xr-x 1 root sys 0 Jun 16 a.20030717
-rwxr-xr-x 1 root sys 2054 Jun 17 search_815.20040621

When I execute "find . -name *.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]", an error message shows "find:missing conjunction".

When I remove the file "a.20030717", and execute same command, "search_815.20040621" was found.

As my understanding, "a.20030717" will be found when I execute the same command. But the result shows NON.

What is the reason?

Can someone advise me?

Thanks
4 REPLIES 4
MarkSyder
Honored Contributor
Solution

Re: error of "find" command

I've often had this problem when I include a * in the search string. To get round it, put the search string in quotes: "*[0-9]etc"

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Joseph Loo
Honored Contributor

Re: error of "find" command

hi,

shouldn't it be:

# find . -name '*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
or
# find . -name '*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' -exec ls -ld {} \;

regards.
what you do not see does not mean you should not believe
Sanjay Kumar Suri
Honored Contributor

Re: error of "find" command

Following works:

find /var/home/sks -name "*.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]"

(use double quotes)

sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Chen Yingjie
Frequent Advisor

Re: error of "find" command

Thank you very much gentlmen.

I have confirmed your suggestions are correct.

Best regards

Chen Yingjie