Thanks for your reply. but,still its showing below error.. Kindly help us to resolve..
$find /user/home/ -mindepth 1 -type f -not -name '.*' -delete && find /user/home/ -type d -not \ (-name '.*' -or -name 'Desktop' -or -name 'thinclient_drives' \) -delete find: paths must precede expression: (-name Usage: find [-H] [-L] [-P] [-O level] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression] Brief details: we want to remove all files except hidden files in user's home dir. and, want to delete all dir except hidden dir, Desktop dir and thinclient_drives dir. we are planning to run this cmd as cron script,which will do scheduled delete of newly created above mentioned category files and dir . if, any other cmd syntex willl do the same, kinldy tell us to get these results. Thanks in Advance. On Fri, Aug 11, 2017 at 9:30 PM, <bug-findutils-requ...@gnu.org> wrote: > Send bug-findutils mailing list submissions to > bug-findutils@gnu.org > > To subscribe or unsubscribe via the World Wide Web, visit > https://lists.gnu.org/mailman/listinfo/bug-findutils > or, via email, send a message with subject or body 'help' to > bug-findutils-requ...@gnu.org > > You can reach the person managing the list at > bug-findutils-ow...@gnu.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of bug-findutils digest..." > > > Today's Topics: > > 1. Fwd: help us to resolve this command (Aman ulla) > 2. Re: Fwd: help us to resolve this command (Kamil Dudka) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 11 Aug 2017 16:17:30 +0530 > From: Aman ulla <inspirea...@gmail.com> > To: bug-findutils@gnu.org > Subject: Fwd: help us to resolve this command > Message-ID: > <CAOouRx5Bea49NtEh6NU8bJfMfaQfeHBkd9cDrZfayuB=r4z...@mail.gmail.com> > Content-Type: text/plain; charset="UTF-8" > > how can i run this command in our centos 7 server to get results..? > > # find /root/home/ -mindepth 1 -type f -not -name '.*' -delete && find > /root/home/ -type d -not \(\-name '.*' -or -name 'Desktop' -or -name > 'thinclient_drives' \) -delete > > this command gives this error. > > find: paths must precede expression: (-name > Usage: find [-H] [-L] [-P] [-Olevel] [-D > help|tree|search|stat|rates|opt|exec] [path...] [expression] > > kindly help us to resolve this.. > > > Thanks in Advance. > > > > > > -- > " Don't pollute it,good planets are hard to find > " > > *-*-* Unity is Strength *-*-* > > Regards, > S.Amanulla > > > > ------------------------------ > > Message: 2 > Date: Fri, 11 Aug 2017 15:51:52 +0200 > From: Kamil Dudka <kdu...@redhat.com> > To: Aman ulla <inspirea...@gmail.com> > Cc: bug-findutils@gnu.org > Subject: Re: Fwd: help us to resolve this command > Message-ID: <2334202.1qaVjhtJO1@kdudka-nb> > Content-Type: text/plain; charset="us-ascii" > > On Friday, August 11, 2017 16:17:30 Aman ulla wrote: >> how can i run this command in our centos 7 server to get results..? > > It depends on which results you want to get. My suggestion is not to run > commands as root unless you really understand what they do ;-) > >> # find /root/home/ -mindepth 1 -type f -not -name '.*' -delete && find >> /root/home/ -type d -not \(\-name '.*' -or -name 'Desktop' -or -name >> 'thinclient_drives' \) -delete >> >> this command gives this error. >> >> find: paths must precede expression: (-name > > The error message sounds clear to me. You likely want to spell \(\-name > as \( -name so that ( ... ) is recognized as operator, instead of badly > positioned path. > > Note that the back slashes are consumed by your shell, not by find itself. > > Kamil > >> Usage: find [-H] [-L] [-P] [-Olevel] [-D >> help|tree|search|stat|rates|opt|exec] [path...] [expression] >> >> kindly help us to resolve this.. >> >> >> Thanks in Advance. >> >> >> >> >> >> -- >> " Don't pollute it,good planets are hard to >> find " >> >> *-*-* Unity is Strength *-*-* >> >> Regards, >> S.Amanulla > > > > ------------------------------ > > Subject: Digest Footer > > _______________________________________________ > bug-findutils mailing list > bug-findutils@gnu.org > https://lists.gnu.org/mailman/listinfo/bug-findutils > > > ------------------------------ > > End of bug-findutils Digest, Vol 173, Issue 2 > ********************************************* -- " Don't pollute it,good planets are hard to find " *-*-* Unity is Strength *-*-* Regards, S.Amanulla