LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "find: unknown predicate" with folder names (https://www.linuxquestions.org/questions/linux-newbie-8/find-unknown-predicate-with-folder-names-4175662385/)

smartdba 10-11-2019 09:48 AM

"find: unknown predicate" with folder names
 
Hi

I have several folders with starting with a "-" in the folder names. They work with most commands, but the find command fails with and unknown predicate. I tried single quotes, double quotes, e\ etc.. but no luck.

Folder example

drwxrwxr-x 2 user group 6 Oct 11 10:33 - test

[user@machine ~]$ find "- test" -name "*.jpeg"
find: unknown predicate `- test'

[user@machine ~]$ find '- test' -name "*.jpeg"
find: unknown predicate `- test'


Please help!

Joe

Ser Olmy 10-11-2019 09:58 AM

find "./- test" -name "*.jpg"

smartdba 10-11-2019 10:00 AM

Thank you very much Ser. It worked perfectly.


All times are GMT -5. The time now is 03:39 PM.