Solved

find: invalid predicate ERROR

Posted on 2006-11-07
5
741 Views
Last Modified: 2012-08-14
Getting an error:

find: invalid predicate `(-name'


find / -type f -a \(-name '*.jpg' -o -name '*.jpe' -o -name '*.JPE' -o -name '*.JPG' -o -name '*.MOV' -o -name '*.mov' -o -name '*.mpg' -o -name '*.MPG' -o -name '*.mpeg' -o -name '*.mp3' -o -name '*.MP3' -o -name '*.mp4' -o -name '*.MP4' -o -name '*.gif' -o -name '*.GIF' -o -name '*.zip' -o -name '*.flv' -o -name '*.fla' -o -name '*.png' -o -name '*.PNG' -o -name '*.pdf' -o -name '*.PDF' -o -name '*.swf' -o -name '*.SWF' -o -name '*.wma' -o -name '*.WMA' -o -name '*.wmv' -o -name '*.WMV' -o -name '*.wav' -o -name '*.WAV' -o -name '*.avi' -o -name '*.AVI' -o -name '*.bmp' -o -name '*.BMP'\) -a  -atime +90 > oldfiles.txt

Don't know why????
0
Comment
Question by:894359
5 Comments
 
LVL 20

Accepted Solution

by:
tfewster earned 300 total points
ID: 17892256
You need a space between the "(" and the "-", i.e.
... \( -name...
0
 
LVL 58

Assisted Solution

by:amit_g
amit_g earned 200 total points
ID: 17892355
Also before last \) i.e. '*.BMP'\) should bne '*.BMP' \)
0
 
LVL 6

Expert Comment

by:bira
ID: 17892401
find / -type f -a -name '*.jpg' -o -name '*.jpe' -o -name '*.JPE' -o -name '*.JPG' -o -name '*.MOV' -o -name '*.mov' -o -name '*.mpg' -o -name '*.MPG' -o -name '*.mpeg' -o -name '*.mp3' -o -name '*.MP3' -o -name '*.mp4' -o -name '*.MP4' -o -name '*.gif' -o -name '*.GIF' -o -name '*.zip' -o -name '*.flv' -o -name '*.fla' -o -name '*.png' -o -name '*.PNG' -o -name '*.pdf' -o -name '*.PDF' -o -name '*.swf' -o -name '*.SWF' -o -name '*.wma' -o -name '*.WMA' -o -name '*.wmv' -o -name '*.WMV' -o -name '*.wav' -o -name '*.WAV' -o -name '*.avi' -o -name '*.AVI' -o -name '*.bmp' -o -name '*.BMP'  -a  -atime +90 > oldfiles.txt
0
 

Author Comment

by:894359
ID: 17893204
Hi Bira... I was told that there was an assumed and and the statement you mentioned would be invalid.

http://www.experts-exchange.com/Operating_Systems/Unix/Q_22033360.html
0
 

Author Comment

by:894359
ID: 17893782
find /home/www/apache2/htdocs -type f -a \( -name '*.jpg' -o -name '*.jpe' -o -name '*.JPE' -o -name '*.JPG' -o -name '*.MOV' -o -name '*.mov' -o -name '*.mpg' -o -name '*.MPG' -o -name '*.mpeg' -o -name '*.mp3' -o -name '*.MP3' -o -name '*.mp4' -o -name '*.MP4' -o -name '*.gif' -o -name '*.GIF' -o -name '*.zip' -o -name '*.flv' -o -name '*.fla' -o -name '*.png' -o -name '*.PNG' -o -name '*.pdf' -o -name '*.PDF' -o -name '*.swf' -o -name '*.SWF' -o -name '*.wma' -o -name '*.WMA' -o -name '*.wmv' -o -name '*.WMV' -o -name '*.wav' -o -name '*.WAV' -o -name '*.avi' -o -name '*.AVI' -o -name '*.bmp' -o -name '*.BMP' \) -a  -atime +90 > oldfiles.txt;
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
My previous tech tip, Installing the Solaris OS From the Flash Archive On a Tape (http://www.experts-exchange.com/articles/OS/Unix/Solaris/Installing-the-Solaris-OS-From-the-Flash-Archive-on-a-Tape.html), discussed installing the Solaris Operating S…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now