i'm looking for the correct syntax for the following find command:
/usr/bin/find /home/user \( -type d \( -iname "*.snapshot*" \) \) -and
\( -type f \( -iname "*.dat" ! -iname "*dat.gz" \) \) -mtime +60 -exec
ls -l {} \;
So what my command should do is find all the .dat files, except
the .dat.gz ones. But not in the .snapshot directory that is residing
in the homefolder too.
Both commands work apart but do not seem to work together. Is there a
way to fix this?
Option -regex doesn't seem to work either.
Regards,
Pieter
> /usr/bin/find /home/user \( -type d \( -iname "*.snapshot*" \) \) -and
> \( -type f \( -iname "*.dat" ! -iname "*dat.gz" \) \) -mtime +60 -exec
> ls -l {} \;
>
> So what my command should do is find all the .dat files, except
> the .dat.gz ones. But not in the .snapshot directory that is residing
> in the homefolder too.
If you don't want to list the .dat files in the .snapshot directory that
resides in the "homeholder", just negate it like you did with *dat.gz
(probably should be *.dat.gz, btw) with a ! -iname homefolder/.snapshot
or whatever the actual homefolder's location would be.
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!